|
|
|
@ -73,7 +73,7 @@ struct PACKED Footer {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// TODO: Rename to Client
|
|
|
|
|
struct Session {
|
|
|
|
|
struct Client {
|
|
|
|
|
|
|
|
|
|
void* buffer;
|
|
|
|
|
size_t max_size;
|
|
|
|
@ -85,15 +85,13 @@ struct Session {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Message* message_new(struct Session* session, uint8_t cmdset, uint8_t cmdid, size_t length, const void* body);
|
|
|
|
|
struct Message* message_new(struct Client* session, uint8_t cmdset, uint8_t cmdid, size_t length, const void* body);
|
|
|
|
|
|
|
|
|
|
// Public stuff
|
|
|
|
|
typedef struct Session* Session;
|
|
|
|
|
typedef struct Client* Client;
|
|
|
|
|
typedef struct Message* Message;
|
|
|
|
|
|
|
|
|
|
Session session_new(void* buffer, size_t size);
|
|
|
|
|
|
|
|
|
|
size_t session_size(Session session);
|
|
|
|
|
Client client_new(void* buffer, size_t size);
|
|
|
|
|
|
|
|
|
|
static const uint8_t CONNECTION_WIFI_AP = 0;
|
|
|
|
|
static const uint8_t CONNECTION_WIFI_STA = 1;
|
|
|
|
@ -132,7 +130,7 @@ struct PACKED SetSdkConnectionResp {
|
|
|
|
|
uint32_t config_ip;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Message set_sdk_connection_req_new(Session session, struct SetSdkConnectionReq* msg);
|
|
|
|
|
const Message set_sdk_connection_req_new(Client session, struct SetSdkConnectionReq* msg);
|
|
|
|
|
|
|
|
|
|
static const uint8_t GET_VERSION_CMDID = 0x01;
|
|
|
|
|
|
|
|
|
@ -146,7 +144,7 @@ struct PACKED GetVersionResp {
|
|
|
|
|
uint8_t dd;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Message get_version_req_new(Session session);
|
|
|
|
|
const Message get_version_req_new(Client session);
|
|
|
|
|
|
|
|
|
|
static const uint8_t SET_SYSTEM_LED_CMDID = 0x33;
|
|
|
|
|
|
|
|
|
@ -189,4 +187,4 @@ struct PACKED SetSystemLedResp {
|
|
|
|
|
uint8_t retcode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Message set_system_led_req_new(Session session, struct SetSystemLedReq* msg);
|
|
|
|
|
const Message set_system_led_req_new(Client session, struct SetSystemLedReq* msg);
|
|
|
|
|