static void prv_handleBootstrapReply(lwm2m_transaction_t * transaction, void * message)
{
    LOG("[BOOTSTRAP] Handling bootstrap reply...\r\n");
    lwm2m_context_t * context = (lwm2m_context_t *)transaction->userData;
    coap_packet_t * coapMessage = (coap_packet_t *)message;
    if (NULL != coapMessage && COAP_TYPE_RST != coapMessage->type)
    {
        handle_bootstrap_response(context, coapMessage, NULL);
    }
    else
    {
        bootstrap_failed(context);
    }
}
Example #2
0
static void prv_handleBootstrapReply(lwm2m_transaction_t * transaction,
                                     void * message)
{
    lwm2m_server_t * bootstrapServer = (lwm2m_server_t *)transaction->userData;
    coap_packet_t * coapMessage = (coap_packet_t *)message;

    LOG("[BOOTSTRAP] Handling bootstrap reply...\r\n");

    if (bootstrapServer->status == STATE_BS_INITIATED)
    {
        if (NULL != coapMessage && COAP_TYPE_RST != coapMessage->type)
        {
            handle_bootstrap_response(bootstrapServer, coapMessage);
        }
        else
        {
            bootstrap_failed(bootstrapServer);
        }
    }
}