Go to the documentation of this file.
61 #include "custom_config.h"
69 #define AGS_SERVICE_UUID 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,\
70 0x00, 0x10, 0x00, 0x00, 0x03, 0xFE, 0x00, 0x00
72 #define AGS_HEADER_FIRST_RES 0x00
74 #define AGS_HEADER_ACK_RES_1 0x00
75 #define AGS_HEADER_ACK_PAYLOAD_LEN 0x02
76 #define AGS_HEADER_ACK_RES_2 0x01
78 #define AGS_TX_VAL_LEN_MAX 244
79 #define AGS_RX_VAL_LEN_MAX 244
89 #define AGS_PAIR_ADV_FLAG 0x01
90 #define AGS_RECONNECT_ADV_FLAG 0x00
93 #define AGS_CONNECTION_MAX 10
100 #define AGS_CHAR_MANDATORY 0x003f
101 #define AGS_CHAR_FULL 0x003f
195 uint8_t total_trxn_length[2];
204 uint8_t total_trxn_length[2];
205 uint8_t payload_length[2];
219 uint8_t payload_length[2];
261 typedef bool (*
ags_stream_cb_t)(uint8_t conn_idx,
const uint8_t *
const p_data, uint16_t length, uint8_t still_receiving);
bool(* ags_stream_cb_t)(uint8_t conn_idx, const uint8_t *const p_data, uint16_t length, uint8_t still_receiving)
Alexa Gadget Service stream callback.
@ AGS_RES_CODE_UNKNOWN
The message was valid but rusulted in a failure or error.
@ AGS_TRANSACTION_TYPE_FIRST
First packet of a transaction, or the only packet in a single-packet transaction.
@ AGS_EVT_ECHO_RX_NOTI_DISABLE
Indicate that the Rx notification has been disabled.
@ AGS_ACK_ACK
The gadget must send an ACK packet in response to the last packet of the transaction.
ags_evt_type_t
Alexa Gadget Service event type.
ags_header_length_ext_t
Alexa Gadget Service Length extender.
@ AGS_CONTROL_STREAM_ID
Control stream ID, used to communicate.
@ AGS_RES_CODE_SUCCESS
The message was valid and acted on (if applicable) successfully.
ags_header_trxn_type_t
Alexa Gadget Service transaction type.
@ AGS_TRANSACTION_TYPE_LAST
Last packet of a transaction.
ags_header_ack_flag_t
Alexa Gadget Service ACK Flag.
@ AGS_LEN_EXT_EXT
The packet's payload is 16 bits.
@ AGS_EVT_ECHO_RX_DATA_SENT
Indicate that the gadget has been sent the data to an Echo device.
void(* ags_evt_handler_t)(ags_evt_t *p_evt)
Alexa Gadget Service event handler type.
@ AGS_TRANSACTION_TYPE_CTRL
Control packet.
@ AGS_EVT_ECHO_RX_NOTI_ENABLE
Indicate that the Rx notification has been enabled.
sdk_err_t ags_non_stream_send(uint8_t conn_idx, void *p_data, uint16_t length)
Send data to the Echo device in non-stream format.
@ AGS_OTA_STREAM_ID
OTA stream ID, used to update the gadget's firmware.
@ AGS_TRANSACTION_TYPE_CONT
Continuation packet of a transaction.
uint16_t sdk_err_t
SDK API result type.
@ AGS_EVT_INVALID
Indicate that invalid event.
sdk_err_t ags_service_init(ags_init_t *p_ags_init)
Initialize a Alexa Gadget Service instance and add in the DB.
ags_header_stream_id_t
Alexa Gadget Service Stream ID.
sdk_err_t ags_stream_send(uint8_t conn_idx, uint8_t stream_id, void *p_data, uint16_t length)
Send data to the Echo device in stream format.
@ AGS_ALEXA_STREAM_ID
Alexa stream ID, used to send directives and events.
@ AGS_EVT_ECHO_TX_DATA_RECEIVED
Indicate that the gadget has been received the data from an Echo device.
@ AGS_ACK_NACK
The gadget doesn't need to send an ACK packet in response to the last packet of the transaction unles...
@ AGS_LEN_EXT_NO_EXT
The packet's payload is 8 bits.
@ AGS_RES_CODE_UNSUPPORTED
The message was invalid because it contained a command or other field that was not supported by the r...
ags_header_result_code_t
Alexa Gadget Service result code.