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.
RN52.h@0:6cf6e566c0da, 2016-01-04 (annotated)
- Committer:
- petter
- Date:
- Mon Jan 04 15:31:12 2016 +0000
- Revision:
- 0:6cf6e566c0da
- Child:
- 2:10c60edc8573
First commit.; Fully working cdc emulator. Control Playback with steering wheel buttons.; Debug outputs on SID.; Playback information to NAV unit not perfect.; RN52 not upgraded to 1.16 so no handling of track metadata.; No handling of phone profile.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
petter | 0:6cf6e566c0da | 1 | #ifndef RN52_H |
petter | 0:6cf6e566c0da | 2 | #define RN52_H |
petter | 0:6cf6e566c0da | 3 | |
petter | 0:6cf6e566c0da | 4 | |
petter | 0:6cf6e566c0da | 5 | typedef enum |
petter | 0:6cf6e566c0da | 6 | { |
petter | 0:6cf6e566c0da | 7 | RN52_PLAYPAUSE, |
petter | 0:6cf6e566c0da | 8 | RN52_NEXTTRACK, |
petter | 0:6cf6e566c0da | 9 | RN52_PREVTRACK, |
petter | 0:6cf6e566c0da | 10 | RN52_CONNECT, |
petter | 0:6cf6e566c0da | 11 | RN52_DISCONNECT, |
petter | 0:6cf6e566c0da | 12 | RN52_REBOOT, |
petter | 0:6cf6e566c0da | 13 | RN52_VOLUMEUP, |
petter | 0:6cf6e566c0da | 14 | RN52_MAXVOLUME, |
petter | 0:6cf6e566c0da | 15 | RN52_GETSTATUS, |
petter | 0:6cf6e566c0da | 16 | RN52_ASSISTANT, |
petter | 0:6cf6e566c0da | 17 | RN52_CALLER_ID, |
petter | 0:6cf6e566c0da | 18 | RN52_TRACK_METADATA, |
petter | 0:6cf6e566c0da | 19 | |
petter | 0:6cf6e566c0da | 20 | RN52_COMMAND_LAST |
petter | 0:6cf6e566c0da | 21 | |
petter | 0:6cf6e566c0da | 22 | } RN52_COMMAND; |
petter | 0:6cf6e566c0da | 23 | |
petter | 0:6cf6e566c0da | 24 | |
petter | 0:6cf6e566c0da | 25 | typedef enum |
petter | 0:6cf6e566c0da | 26 | { |
petter | 0:6cf6e566c0da | 27 | RN52_LIMBO, |
petter | 0:6cf6e566c0da | 28 | RN52_CONNECTABLE, |
petter | 0:6cf6e566c0da | 29 | RN52_CONNECTABLE_DISCOVERABLE, |
petter | 0:6cf6e566c0da | 30 | RN52_CONNECTED, |
petter | 0:6cf6e566c0da | 31 | RN52_OUTGOING_CALL, |
petter | 0:6cf6e566c0da | 32 | RN52_INCOMING_CALL, |
petter | 0:6cf6e566c0da | 33 | RN52_ACTIVE_CALL, |
petter | 0:6cf6e566c0da | 34 | RN52_TEST_MODE, |
petter | 0:6cf6e566c0da | 35 | RN52_THREE_WAY_CALL_WAITING, |
petter | 0:6cf6e566c0da | 36 | RN52_THREE_WAY_CALL_ON_HOLD, |
petter | 0:6cf6e566c0da | 37 | RN52_THREE_WAY_CALL_MULTI_CALL, |
petter | 0:6cf6e566c0da | 38 | RN52_ACTIVE_CALL2, |
petter | 0:6cf6e566c0da | 39 | RN52_AUDIO_STREAMING, |
petter | 0:6cf6e566c0da | 40 | RN52_LOW_BATTERY, |
petter | 0:6cf6e566c0da | 41 | |
petter | 0:6cf6e566c0da | 42 | RN52_CONNECTION_LAST |
petter | 0:6cf6e566c0da | 43 | |
petter | 0:6cf6e566c0da | 44 | } RN52_CONNECTION; |
petter | 0:6cf6e566c0da | 45 | |
petter | 0:6cf6e566c0da | 46 | |
petter | 0:6cf6e566c0da | 47 | typedef enum |
petter | 0:6cf6e566c0da | 48 | { |
petter | 0:6cf6e566c0da | 49 | RN52_NO_EVENT, |
petter | 0:6cf6e566c0da | 50 | RN52_OTHER_EVENT, |
petter | 0:6cf6e566c0da | 51 | RN52_CALLER_ID_EVENT, |
petter | 0:6cf6e566c0da | 52 | RN52_TRACK_CHANGE_EVENT, |
petter | 0:6cf6e566c0da | 53 | |
petter | 0:6cf6e566c0da | 54 | RN52_EVENT_LAST |
petter | 0:6cf6e566c0da | 55 | |
petter | 0:6cf6e566c0da | 56 | } RN52_EVENT; |
petter | 0:6cf6e566c0da | 57 | |
petter | 0:6cf6e566c0da | 58 | typedef struct |
petter | 0:6cf6e566c0da | 59 | { |
petter | 0:6cf6e566c0da | 60 | RN52_EVENT event; |
petter | 0:6cf6e566c0da | 61 | bool media_connected; |
petter | 0:6cf6e566c0da | 62 | bool phone_connected; |
petter | 0:6cf6e566c0da | 63 | RN52_CONNECTION connection; |
petter | 0:6cf6e566c0da | 64 | char response[40]; |
petter | 0:6cf6e566c0da | 65 | |
petter | 0:6cf6e566c0da | 66 | } RN52_RESULT; |
petter | 0:6cf6e566c0da | 67 | |
petter | 0:6cf6e566c0da | 68 | |
petter | 0:6cf6e566c0da | 69 | |
petter | 0:6cf6e566c0da | 70 | |
petter | 0:6cf6e566c0da | 71 | //---------------------------------------------------------------------------- |
petter | 0:6cf6e566c0da | 72 | // CLASS |
petter | 0:6cf6e566c0da | 73 | //---------------------------------------------------------------------------- |
petter | 0:6cf6e566c0da | 74 | |
petter | 0:6cf6e566c0da | 75 | class RN52 |
petter | 0:6cf6e566c0da | 76 | { |
petter | 0:6cf6e566c0da | 77 | public: |
petter | 0:6cf6e566c0da | 78 | void init(); |
petter | 0:6cf6e566c0da | 79 | bool changed(); |
petter | 0:6cf6e566c0da | 80 | bool set(RN52_COMMAND cmd); |
petter | 0:6cf6e566c0da | 81 | bool get(RN52_COMMAND cmd, RN52_RESULT * rn52_result); |
petter | 0:6cf6e566c0da | 82 | void capture_response(char * str); |
petter | 0:6cf6e566c0da | 83 | }; |
petter | 0:6cf6e566c0da | 84 | |
petter | 0:6cf6e566c0da | 85 | #endif |