Beispiel #1
0
int16_t parse_cmd_fht_send(char *cmd, char *output, uint16_t len)
{
#ifdef DEBUG_ECMD_FS20
    debug_printf("called with string %s\n", cmd);
#endif

    uint16_t hc, addr, c, c2;

    int ret = sscanf_P(cmd, PSTR("%x %x %x %x"),
                       &hc, &addr, &c, &c2);

    if (ret == 3 || ret == 4)
    {
        if (ret == 3)
        {
            c2 = 0;
        }


#ifdef DEBUG_ECMD_FS20
        debug_printf("fht_send(0x%x,0x%x,0x%x,0x%x)\n", hc, LO8(addr), LO8(c), LO8(c2));
#endif

        fs20_send(1, hc, LO8(addr), LO8(c), LO8(c2));
        return ECMD_FINAL_OK;
    }
    return ECMD_ERR_PARSE_ERROR;
}
Beispiel #2
0
void fs20_sendSensorValue(uint8_t sensorStatus)
{
	uint8_t fs20_cmd = sensorStatus?FS20_CODE_ON:FS20_CODE_OFF;

	uint8_t data[4];
	data[0] = fs20_housecode>>8;
	data[1] = fs20_housecode & 0xff;
	data[2] = fs20_button;
	data[3] = fs20_cmd;

	fs20_send(data,4);
}
Beispiel #3
0
int16_t parse_cmd_fs20_send(char *cmd, char *output, uint16_t len)
{
#ifdef DEBUG_ECMD_FS20
    debug_printf("called with string %s\n", cmd);
#endif

    uint16_t hc, addr, c, c2;

    int ret = sscanf_P(cmd, PSTR("%x %x %x %x"),
                       &hc, &addr, &c, &c2);

    if (ret == 3 || ret == 4)
    {
        if (ret == 3)
        {
            c2 = 0;
        }

#ifdef DEBUG_ECMD_FS20
        debug_printf("fs20_send(0x%x,0x%x,0x%x,0x%x)\n", hc, LO8(addr), LO8(c), LO8(c2));
#endif

#ifdef REC868_SUPPORT
        rec868_stop(); //Empfang waehrend des Sendens abschalten
#endif
        fs20_send(0, hc, LO8(addr), LO8(c), LO8(c2));
#ifdef REC868_SUPPORT
        if(rec868_global.stat.fs20 | rec868_global.stat.wett | rec868_global.stat.hell)
            rec868_start();
#endif
        return ECMD_FINAL_OK;
    }

    return ECMD_ERR_PARSE_ERROR;

}