-
Notifications
You must be signed in to change notification settings - Fork 1
/
CSmaProbe.h
52 lines (39 loc) · 1.36 KB
/
CSmaProbe.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
/*
* Copyright (c) 2012 Alexandros Nikolopoulos <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#ifndef CSMAPROBE_H_
#define CSMAPROBE_H_
#include "fpd.h"
#include "CBlueTooth.h"
#include "CLog.h"
class CSmaProbe : public CProbe
{
public:
CSmaProbe(CInterface *Iface, string uuid);
CSmaProbe(CInterface *Iface, list<int> sensors,string uuid);
virtual ~CSmaProbe();
int Start(void);
int Stop(void);
int GetAverage(DataContainer &AverageData);
list<int> GetConnectedInverters(void);
int ResetStack(void);
private:
int Login(void);
int StripEscapes(uint8_t *buffer, uint32_t len);
int AddEscapes(uint8_t *buffer, uint32_t len);
u_int16_t CalcCRC(u_int16_t fcs, void *_cp, int len);
void GenerateCRC(uint8_t * buffer, int len, uint8_t * cs);
void WaitForCode(struct smadata2_l1_packet *p, int cmdcode);
int Level1Read(struct smadata2_l1_packet *p);
int Level1Write(struct smadata2_l1_packet *p);
int Level2Read(uint8_t *buffer, int len, struct smadata2_l2_packet *p);
int Level2Write(uint8_t * buffer, struct smadata2_l2_packet *p);
CInterface *m_Connection;
uint8_t m_packetCount;
};
#endif /* CSMAPROBE_H_ */