31 if (!packets.push(&tmpPkt)) {
41 return packets.size();
46 while (packets.size()) {
47 Packet *pkt = packets.front();
57 return lwm2m_set_coap_block_size(size);
61 return lwm2m_get_coap_block_size();
66 while (packets.size()) {
67 Packet *pkt = packets.front();
95 WPP_LOGE(
TAG_WPP_CONN,
"Not posible connect to server: security obj ID-> %d, session -> %p", secObjInstID, session);
97 WPP_LOGI(
TAG_WPP_CONN,
"Connected to server: security obj ID-> %d, session -> %p", secObjInstID, session);
117 return COAP_500_INTERNAL_SERVER_ERROR;
121 WPP_LOGD(
TAG_WPP_CONN,
"Sending buffer to server: session -> %p, size -> %d", sessionH, length);
123 WPP_LOGD(
TAG_WPP_CONN,
"Sending buffer to server: session -> %p, result -> %d", sessionH, result);
124 return result? COAP_NO_ERROR : COAP_500_INTERNAL_SERVER_ERROR;
#define WPP_CONN_I_PACKETS_QUEUE_SIZE
#define WPP_LOGE(TAG, FMT,...)
#define WPP_LOGD(TAG, FMT,...)
#define WPP_LOGI(TAG, FMT,...)
static Lwm2mSecurity * instance(WppClient &ctx, ID_T instId=ID_T_MAX_VAL)
Gets an instance of the object.
Represents a client interface for Wpp library.
lwm2m_context_t & getContext()
Gets the LwM2M context associated with the WppClient.
WppConnection & connection()
Gets the WppConnection associated with the WppClient.
virtual SESSION_T connect(Lwm2mSecurity &security)=0
Establishes a connection using the provided Lwm2mSecurity object.
uint16_t getDataBlockSize()
Retrieves the COAP block size.
virtual void disconnect(SESSION_T session)=0
Disconnects from the specified session.
virtual bool sendPacket(const Packet &packet)=0
Sends a packet over the connection.
void clearPacketQueue()
Clears the packet queue.
virtual bool sessionCmp(SESSION_T session1, SESSION_T session2)=0
Compares two session identifiers.
bool setDataBlockSize(uint16_t size)
Sets the COAP block size.
bool addPacketToQueue(const Packet &packet)
Adds a packet to the packet queue.
uint8_t getPacketQueueSize()
Retrieves the size of the packet queue.
void handlePacketsInQueue(WppClient &client)
Processes the packets in the packet queue.
The WppConnection class represents a connection interface for the Wpp library.
void lwm2m_close_connection(void *sessionH, void *userData)
bool lwm2m_session_is_equal(void *session1, void *session2, void *userData)
void * lwm2m_connect_server(uint16_t secObjInstID, void *userData)
uint8_t lwm2m_buffer_send(void *sessionH, uint8_t *buffer, size_t length, void *userData)