semilimes mcu sdk 1.0.1
semilimes Software Development Kit for microcontrollers
Loading...
Searching...
No Matches
dc_contact.h
1#ifndef _dc_contact_
2#define _dc_contact_
3
4#include "../defines.h"
5
7{
8private:
9 #define headerSize 31
10 #define headerArraySize 2
11 SmeJson json_data;
12 char* json = nullptr;
13 char* jsonArray = nullptr;
14
15public:
16/* Function: DcContact
17
18 A message that references one or more account Ids to be added as contacts
19
20 Prototype:
21 void DcContact::set();
22
23 Parameters:
24
25 Returns:
26 void
27*/
28 DcContact()
29 {
30 int size = headerSize+1;//add '\0' for null-termination
31 json = new char[size];
32
33 json_data.initJson(json);
34 json_data.addPair2JsonStr(json,"dataComponentType","contact");
35 }
36
37// Function: ~DcContact
38
39// distructor of the class, frees up the memory occupied by the array/s
40
41// Prototype:
42// ~DcContact()
43
44// Parameters:
45
46// Returns:
49 {
50 delete[] json;
51 delete[] jsonArray;
52 json = nullptr;
53 jsonArray = nullptr;
54 }
55
56// Function: DcContact.addContactIds
57
58// Add a contact Id to the array
59
60// Prototype:
61// void DcContact::addContactIds(char* contactIds);
62
63// Parameters:
65
66// Returns:
68 void addContactIds(char* data);
69
70// Function: DcContact.appendContactIds
71
72// Append the contact Id array to the json message
73
74// Prototype:
75// void DcContact::appendContactIds();
76
77// Parameters:
78
79// Returns:
81 void appendContactIds();
82
83// Function: DcContact.get
84
85// return the json script
86
87// Prototype:
88// void DcContact::get();
89
90// Parameters:
91
92// Returns:
94 char* get();
95};
96
97#endif
Definition dc_contact.h:7
char * get()
Definition dc_contact.cpp:64
~DcContact()
Definition dc_contact.h:48
void addContactIds(char *data)
Definition dc_contact.cpp:16
void appendContactIds()
Definition dc_contact.cpp:45