This is the Pubnub library for MBed2 ("classic") with the "sync" interface. It is based on the Pubnub C-core library.

Dependencies:   Pubnub_c_core_mbed2_pal

Dependents:   Pubnub_ATT_IoT_SK_WNC_sync pubnub_sync

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pubnub_ntf_sync.h Source File

pubnub_ntf_sync.h

Go to the documentation of this file.
00001 /* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */
00002 #if !defined INC_PUBNUB_NTF_SYNC
00003 #define INC_PUBNUB_NTF_SYNC
00004 
00005 
00006 #include "pubnub_api_types.h"
00007 
00008 
00009 /** @file pubnub_ntf_sync.h 
00010     This is the "sync" notification interface.
00011 
00012     Pubnub client library offers two "mostly portable" interfaces for
00013     getting notification about the outcome of a Pubnub transaction.
00014     Those are:
00015     - sync (this one)
00016     - callback
00017 
00018     There are others, which are specific to a platform (like process
00019     events for Contiki OS). Also, not all platforms support the
00020     two "mostly portable" interfaces mentioned above.
00021 
00022     Sync interfaces is the simplest. You just check for the (last)
00023     result of a context (by using pubnub_last_result()) and when it
00024     becomes something other than #PNR_STARTED, you have your
00025     outcome. 
00026 
00027     Since pubnub_last_result() is part of the "Core API", this
00028     interface only provides one additional, helper function, which
00029     will wait in a loop for the transaction to finish.  While
00030     pubnub_last_result() is available in all Pubnub client libraries,
00031     pubnub_await() is not.
00032 */
00033 
00034 
00035 /** Waits, in a loop, for the current transaction to finish. */
00036 enum pubnub_res pubnub_await(pubnub_t *p);
00037 
00038 
00039 #endif        /* defined INC_PUBNUB_NTF_CONTIKI */