Streams encoded audio frames from the watch to the phone.
More...
Streams encoded audio frames from the watch to the phone.
Only one transfer session can be active at a time. While a session is active, the Bluetooth connection is kept in its low latency mode. Frames that do not fit in the send buffer are dropped.
}
AudioEndpointSessionId audio_endpoint_setup_transfer(AudioEndpointStopTransferCallback stop_transfer)
Create a session for transferring audio from the watch to the phone.
uint16_t AudioEndpointSessionId
Identifies a transfer session.
Definition audio_endpoint.h:29
void audio_endpoint_add_frame(AudioEndpointSessionId session_id, uint8_t *frame, uint8_t frame_size)
Send a frame of encoded audio.
#define AUDIO_ENDPOINT_SESSION_INVALID_ID
Invalid session identifier.
Definition audio_endpoint.h:31
void audio_endpoint_stop_transfer(AudioEndpointSessionId session_id)
End a transfer and send a stop transfer message to the phone.
◆ DataTransferMsg
| Data Fields |
|
uint8_t |
frame_count |
Number of frames that follow. |
|
uint8_t |
frames[] |
Frames, each a length byte followed by that many bytes of encoded audio. |
|
MsgId |
msg_id |
MsgIdDataTransfer. |
|
AudioEndpointSessionId |
session_id |
Transfer session. |
◆ StopTransferMsg
◆ AUDIO_ENDPOINT_SESSION_INVALID_ID
| #define AUDIO_ENDPOINT_SESSION_INVALID_ID (0) |
Invalid session identifier.
◆ AudioEndpointSessionId
Identifies a transfer session.
◆ AudioEndpointStopTransferCallback
Called when the phone asks to stop a transfer.
- Parameters
-
| session_id | Session being stopped. |
◆ MsgId
Audio endpoint message types.
| Enumerator |
|---|
| MsgIdDataTransfer | Audio frames, watch to phone.
|
| MsgIdStopTransfer | End of transfer, in either direction.
|
◆ audio_endpoint_add_frame()
Send a frame of encoded audio.
Ignored if session_id is not the active session. Never blocks; the frame is dropped if the send buffer is full.
- Parameters
-
◆ audio_endpoint_cancel_transfer()
End a transfer without notifying the phone.
The stop callback is not called.
- Parameters
-
◆ audio_endpoint_setup_transfer()
Create a session for transferring audio from the watch to the phone.
- Parameters
-
| stop_transfer | Called when the phone sends a stop transfer message. |
- Returns
- Session identifier, or AUDIO_ENDPOINT_SESSION_INVALID_ID if a session is already active.
◆ audio_endpoint_stop_transfer()
End a transfer and send a stop transfer message to the phone.
The stop callback is not called.
- Parameters
-