-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcoapresource.h
More file actions
42 lines (34 loc) · 1.29 KB
/
coapresource.h
File metadata and controls
42 lines (34 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef COAPRESOURCE_H
#define COAPRESOURCE_H
#include <stdint.h>
#include <cantcoap.h>
class CoAPResource
{
public:
CoAPResource();
virtual char *getUri();
virtual int setUri(char *uri);
virtual CoapPDU::Code getCode();
virtual uint8_t* getPayloadPointer();
virtual int getPayloadLength();
virtual void setPayload(uint8_t *value, int len);
virtual CoapPDU::ContentFormat getContentFormat();
// TODO: inputPayload, CoapPDU::ContentFormat, but we need Arguments too:
virtual bool getMethodIsPrivate();
virtual int getMethod(uint8_t *payloadValue, int payloadLen,
CoapPDU::ContentFormat contentFormat);
virtual int putMethod(uint8_t *payloadValue, int payloadLen,
CoapPDU::ContentFormat contentFormat);
virtual bool putMethodIsPrivate();
virtual int postMethod(uint8_t *payloadValue, int payloadLen,
CoapPDU::ContentFormat contentFormat);
virtual bool postMethodIsPrivate();
virtual int deleteMethod(uint8_t *payloadValue, int payloadLen,
CoapPDU::ContentFormat contentFormat);
virtual bool deleteMethodIsPrivate();
virtual bool isObservable();
virtual bool isResourceChanged();
protected:
char *uri;
};
#endif // COAPRESOURCE_H