client version of coap
Dependencies: nRF24L01P cantcoap3
Diff: coapClient.h
- Revision:
- 2:e8823d9fa162
- Parent:
- 1:1d936c763440
- Child:
- 5:d633e12f113f
--- a/coapClient.h Sun Jan 20 13:48:02 2019 +0000 +++ b/coapClient.h Thu Jan 24 16:33:30 2019 +0000 @@ -20,7 +20,7 @@ }; private: - uint8_t token[4]; + uint8_t token[1]; uint16_t message_counter; int listeningTimeout; int retransmissionLimit; @@ -28,18 +28,21 @@ public: - CoapClient(uint8_t* token, int retransmissionLimit, int timeout, int channel, unsigned long long rx_address, unsigned long long tx_address); + CoapClient(uint8_t* token, int retransmissionLimit, int timeout, int channel, unsigned long long rx_address, + unsigned long long tx_address); + int get(uint8_t buffer[], int len, char* uri); int post(uint8_t buffer[], int len, char* uri); - private: uint16_t preparePDU(CoapPDU& coapPDU); bool isAck(CoapPDU& coapPDU, uint16_t message_id, char* uri); - int sendReset(uint16_t message_id); + bool hasGetResponse(CoapPDU& response); + + bool hasPostResponse(CoapPDU& response); }; #endif //COAPCLIENT_H