{"action":"created","issue":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/283","repository_url":"https://api.github.com/repos/bbcmicrobit/micropython","labels_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/283/comments","events_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/283/events","html_url":"https://github.com/bbcmicrobit/micropython/pull/283","id":156768025,"number":283,"title":"Implement simple radio module to send/recv strings.","user":{"login":"dpgeorge","id":6187689,"avatar_url":"https://avatars.githubusercontent.com/u/6187689?v=3","gravatar_id":"","url":"https://api.github.com/users/dpgeorge","html_url":"https://github.com/dpgeorge","followers_url":"https://api.github.com/users/dpgeorge/followers","following_url":"https://api.github.com/users/dpgeorge/following{/other_user}","gists_url":"https://api.github.com/users/dpgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgeorge/subscriptions","organizations_url":"https://api.github.com/users/dpgeorge/orgs","repos_url":"https://api.github.com/users/dpgeorge/repos","events_url":"https://api.github.com/users/dpgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/dpgeorge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2016-05-25T14:40:00Z","updated_at":"2016-07-09T15:26:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/283","html_url":"https://github.com/bbcmicrobit/micropython/pull/283","diff_url":"https://github.com/bbcmicrobit/micropython/pull/283.diff","patch_url":"https://github.com/bbcmicrobit/micropython/pull/283.patch"},"body":"This is a first attempt at implementing a radio module.  It's completely self contained (ie does not use the DAL) but the settings for the radio are compatible with the DAL's settings.\r\n\r\nThere are many things than can be improved/added/changed, but this is a good starting point to have a discussion about how the radio should be exposed in Python.\r\n\r\nTo use:\r\n```\r\nimport radio\r\nradio.enable(32, 4) # max payload is 32 bytes, queue length is 4\r\nradio.send('hello!') # send a message to everyone listening\r\nradio.recv() # receive any pending messages on the queue; returns None if none available\r\n```\r\nYou'll need 2 or more microbits to try it out.  It's a simple broadcast of messages and everyone uses the same channel and address (which can be configured but there's no such functionality yet).\r\n\r\nOne other thing: you'll need to edit the DAL to get this working.  In `yotta_modules/microbit-dal/source/ble-services/MicroBitRadio.cpp` delete the entire RADIO_IRQHandler function between lines 29 and 57."},"comment":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/comments/231539769","html_url":"https://github.com/bbcmicrobit/micropython/pull/283#issuecomment-231539769","issue_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/283","id":231539769,"user":{"login":"finneyj","id":11539567,"avatar_url":"https://avatars.githubusercontent.com/u/11539567?v=3","gravatar_id":"","url":"https://api.github.com/users/finneyj","html_url":"https://github.com/finneyj","followers_url":"https://api.github.com/users/finneyj/followers","following_url":"https://api.github.com/users/finneyj/following{/other_user}","gists_url":"https://api.github.com/users/finneyj/gists{/gist_id}","starred_url":"https://api.github.com/users/finneyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finneyj/subscriptions","organizations_url":"https://api.github.com/users/finneyj/orgs","repos_url":"https://api.github.com/users/finneyj/repos","events_url":"https://api.github.com/users/finneyj/events{/privacy}","received_events_url":"https://api.github.com/users/finneyj/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T15:26:11Z","updated_at":"2016-07-09T15:26:11Z","body":"Guys, we could patch 1.4.x if really needed but we've really left that behind since microbit.co.uk was locked down. In 2.x you could simply just not include the radio component in your build, which would be a lot cleaner.\r\n\r\nSeems a shame to duplicate stuff though... if you've got a better, compatible implementation, we could consider upstreaming/merging it so everyone's running the same core? We'd welcome improvements..."}}
{"actor":{"display_login":"finneyj"}}