00001
00002
00003
00004
00005
00006
00007 #ifndef GLACSWEB_PROBE_COMS_H
00008 #define GLACSWEB_PROBE_COMS_H
00009
00010 #include "glacsweb_protocol.h"
00011 #include "serial.h"
00012
00013 void printPacket(glacsweb_packet *tempPacket);
00014 void set_packet(unsigned char size,
00015 unsigned char id,
00016 unsigned char cmd,
00017 unsigned char data[16],
00018 glacsweb_packet *tempPacket);
00019 void send_packet(glacsweb_packet *p, SerialPort *sp);
00020 int send_packet_wait_reply(glacsweb_packet *TxPacket,
00021 glacsweb_packet *RxPacket,
00022 SerialPort *sp,
00023 unsigned char retries);
00024 int receive_packet(glacsweb_packet *RxPacket, SerialPort *sp);
00025 void probe_rtc_set_alarm(unsigned char id, int min, int hour, int day,
00026 SerialPort * sp);
00027 void probe_sys_sleep(unsigned char id,
00028 SerialPort * sp);
00029 void probe_sys_loadparams(unsigned char id, SerialPort *sp);
00030 int probe_eeprom_read16(unsigned char id, int address,
00031 glacsweb_packet *rxpkt, SerialPort *sp);
00032 int probe_sys_eeprom_read(int id, unsigned char address, SerialPort *sp);
00033 int probe_sys_eeprom_write(int id, unsigned char address,
00034 unsigned char value, SerialPort *sp);
00035 int probe_get_params(unsigned char id, int *ee_rd, int *ee_wr, SerialPort *sp);
00036 void broadcast_sys_eeprom_write(unsigned char address, unsigned char value, unsigned int delay, unsigned char retries, SerialPort *sp);
00037 void broadcast_sys_load_params(unsigned int delay, unsigned char retries, SerialPort *sp);
00038 void broadcast_rtc_set_time(unsigned int delay, unsigned char retries, SerialPort *sp);
00039 void broadcast_rtc_set_date(unsigned int delay, unsigned char retries, SerialPort *sp);
00040 void broadcast_rtc_set_alarm(int min, int hour, int date, unsigned int delay, unsigned char retries, SerialPort *sp);
00041 int probe_get_batvolts(unsigned char id, float *value, SerialPort *sp);
00042
00043
00044 #endif // GLACSWEB_PROBE_COMS_H