Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 6:c454f88524d6
- Parent:
- 5:8e468fef2754
- Child:
- 7:2df2c6e8c0df
--- a/main.cpp Mon Jan 11 20:49:59 2016 +0000 +++ b/main.cpp Wed Jan 13 22:11:50 2016 +0000 @@ -84,24 +84,40 @@ if(rn52.check_event(&res)) { switch (res.event) { case RN52_CALLER_ID_EVENT: + printf("Caller ID event\r\n"); break; case RN52_TRACK_CHANGE_EVENT: cdc.reset_elapsed_time(); + printf("Track change event\r\n"); + printf("title: %s", res.title); + printf("artist: %s", res.artist); + printf("album: %s", res.album); + printf("genre: %s", res.genre); + printf("duration: %i\r\n", res.duration); + printf("track_count: %i\r\n", res.track_count); + printf("track_number: %i\r\n", res.track_number); + //cdc.display(res.title); + //cdc.set_track((char)res.track_number); break; case RN52_NO_EVENT: //no specific event occured, check connection status switch(res.connection) { + case RN52_CONNECTABLE_DISCOVERABLE: + printf("Waiting for connection\r\n"); + cdc.display("BT REDO"); + break; case RN52_CONNECTED: + printf("Connected\r\n"); cdc.display("BT ANSLUTEN"); rn52.maxvolume(); break; case RN52_AUDIO_STREAMING: + printf("Streaming\r\n"); cdc.display("BT SPELAR"); cdc.start_elapsed_time(); break; } if(res.connection != RN52_AUDIO_STREAMING) { cdc.stop_elapsed_time(); - cdc.reset_elapsed_time(); } } }