e12
 
Loading...
Searching...
No Matches
e12_client.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 e12.io
3 * All rights reserved.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#ifndef H_E12_CLIENT
20#define H_E12_CLIENT
21
22#include <Wire.h>
23
24#include "Arduino.h"
25//
26#include <e12_protocol.h>
27
29
30class e12_client : public e12_arduino {
31 private:
32 public:
33 e12_client(uint32_t vid, uint32_t pid) : e12_arduino(vid, pid) {}
34
36 int wakeup_e12_node();
37 int sleep(uint32_t ms, void* data);
38 int send(e12_packet_t* buf, bool retry = true);
40};
41
42#endif
Class to handle e12 protocol on Arduino.
Definition arduino_e12_protocol.h:40
Definition e12_client.h:30
~e12_client()
Definition e12_client.h:35
int sleep(uint32_t ms, void *data)
Put the device to sleep.
Definition e12_client.cpp:61
int on_receive(e12_packet_t *p)
Handles the received packet.
Definition e12_client.cpp:104
e12_client(uint32_t vid, uint32_t pid)
Definition e12_client.h:33
int wakeup_e12_node()
Wakes up the e12 node.
Definition e12_client.cpp:52
int send(e12_packet_t *buf, bool retry=true)
Send a packet to the e12 device.
Definition e12_client.cpp:43
e12_packet_t
Definition e12_protocol.h:357