-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wisol.h
66 lines (55 loc) · 1.64 KB
/
Wisol.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
WISOL.h - Interface for Sigfox library.
Created by Thomas Ho, Thinxtra Solutions Pty.
January 19, 2017.
Updated August 9, 2017.
Released into the public domain.
*/
#ifndef WISOL_h
#define WISOL_h
#include "Arduino.h"
#include "Isigfox.h"
#define RCZ1 1
#define RCZ2 2
#define RCZ3 3
#define RCZ4 4
class WISOL : public Isigfox
{
public:
WISOL(){}
~WISOL(){}
int initSigfox();
void configIO(pinIO pin);
int testComms();
int sendPayload(uint8_t *outData, const uint8_t len, const int downlink, recvMsg *receivedMsg);
int sendPayload(uint8_t *outData, const uint8_t len, const int downlink);
int sendMessage(char *outData, const uint8_t len, recvMsg *receivedMsg);
int getdownlinkMsg(recvMsg *receivedMsg);
int getZone();
int setZone();
int setPublicKey();
int setPrivateKey();
int resetMacroChannel();
private:
void Buffer_Init();
int getRecvMsg(recvMsg *receivedMsg, const int downlink);
int prepareZone();
recvMsg goDeepSleep();
void wakeDeepSleep();
int strCmp(char *in1, char *in2, const int len);
void printRecv(char* in, const int len);
void clearBuffer();
void ASCII2Hex(uint8_t* input, int length, char* buf_str);
int sendPayloadProcess(uint8_t *outData, const uint8_t len, int downlink, recvMsg *receivedMsg);
int getdownlinkMsg(int downlink, recvMsg *receivedMsg);
void checkChangeZone();
static const int BUFFER_SIZE = 40;
char master_receive[BUFFER_SIZE] = {0};
// char* master_receive;
int currentZone;
typedef enum{
Exit=0,
Send_Wakeup, /*!< Wakes up OL2361 */
}e_SPI_command_code;
};
#endif