Пример #1
0
int8_t irkit_httpclient_post_messages() {
    // post body is IR data, move devicekey parameter to query, for implementation simplicity
    // /p?devicekey=C7363FDA0F06406AB11C29BA41272AE3&freq=38
    char path[54];
    sprintf(path, P("/p?devicekey=%s&freq=%d"), keys.getKey(), IrCtrl.freq);
    return gs.postBinary( path,
                          (const char*)sharedbuffer, IR_packedlength(),
                          &on_post_messages_response,
                          10 );
}
Пример #2
0
int8_t irkit_httpclient_post_messages_() {
    // post body is IR data, move devicekey parameter to query, for implementation simplicity
    // /p?devicekey=C7363FDA0F06406AB11C29BA41272AE3&freq=38
    char path[54];
    sprintf(path, P("/p?devicekey=%s&freq=%d"), keys.getKey(), IrCtrl.freq);
    int8_t cid = gs.postBinary( path,
                                (const char*)sharedbuffer, IR_packedlength(),
                                &on_post_messages_response,
                                10 );
    if (cid == polling_cid) {
        // we're polling on this cid, and our response handler is registered with this cid.
        // we already overwritten the response handler, so restart everything.
        // HTTPLOG_PRINTLN("!E30");
        wifi_hardware_reset();
        return -1;
    }
    return cid;
}