Esempio n. 1
0
static void on_json_data( uint8_t key, uint32_t value ) {
    if ( IrCtrl.state != IR_WRITING ) {
        return;
    }

    switch (key) {
    case IrJsonParserDataKeyId:
        newest_message_id = value;
        break;
    case IrJsonParserDataKeyFreq:
        IrCtrl.freq = value;
        break;
    case IrJsonParserDataKeyData:
        IR_put( value );
        break;
    default:
        break;
    }
}
Esempio n. 2
0
static void on_json_data( uint8_t key, uint32_t value, char *pass ) {
    if ( IrCtrl.state != IR_WRITING ) {
        return;
    }

    switch (key) {
    case IrJsonParserDataKeyId:
        newest_message_id = value;
        break;
    case IrJsonParserDataKeyFreq:
        IrCtrl.freq = value;
        break;
    case IrJsonParserDataKeyData:
        IR_put( value );
        break;
    case IrJsonParserDataKeyPass:
        if (strncmp(pass, gs.password(), 10) == 0) {
            has_valid_pass = true;
        }
    default:
        break;
    }
}