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

Committer:
sveljko
Date:
Thu Nov 10 22:25:17 2016 +0000
Revision:
0:243e0d70a1d5
Initial commit of the Pubnub library for MBed2 with the "sync" interface.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sveljko 0:243e0d70a1d5 1 /* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */
sveljko 0:243e0d70a1d5 2 #if !defined INC_PUBNUB_NTF_SYNC
sveljko 0:243e0d70a1d5 3 #define INC_PUBNUB_NTF_SYNC
sveljko 0:243e0d70a1d5 4
sveljko 0:243e0d70a1d5 5
sveljko 0:243e0d70a1d5 6 #include "pubnub_api_types.h"
sveljko 0:243e0d70a1d5 7
sveljko 0:243e0d70a1d5 8
sveljko 0:243e0d70a1d5 9 /** @file pubnub_ntf_sync.h
sveljko 0:243e0d70a1d5 10 This is the "sync" notification interface.
sveljko 0:243e0d70a1d5 11
sveljko 0:243e0d70a1d5 12 Pubnub client library offers two "mostly portable" interfaces for
sveljko 0:243e0d70a1d5 13 getting notification about the outcome of a Pubnub transaction.
sveljko 0:243e0d70a1d5 14 Those are:
sveljko 0:243e0d70a1d5 15 - sync (this one)
sveljko 0:243e0d70a1d5 16 - callback
sveljko 0:243e0d70a1d5 17
sveljko 0:243e0d70a1d5 18 There are others, which are specific to a platform (like process
sveljko 0:243e0d70a1d5 19 events for Contiki OS). Also, not all platforms support the
sveljko 0:243e0d70a1d5 20 two "mostly portable" interfaces mentioned above.
sveljko 0:243e0d70a1d5 21
sveljko 0:243e0d70a1d5 22 Sync interfaces is the simplest. You just check for the (last)
sveljko 0:243e0d70a1d5 23 result of a context (by using pubnub_last_result()) and when it
sveljko 0:243e0d70a1d5 24 becomes something other than #PNR_STARTED, you have your
sveljko 0:243e0d70a1d5 25 outcome.
sveljko 0:243e0d70a1d5 26
sveljko 0:243e0d70a1d5 27 Since pubnub_last_result() is part of the "Core API", this
sveljko 0:243e0d70a1d5 28 interface only provides one additional, helper function, which
sveljko 0:243e0d70a1d5 29 will wait in a loop for the transaction to finish. While
sveljko 0:243e0d70a1d5 30 pubnub_last_result() is available in all Pubnub client libraries,
sveljko 0:243e0d70a1d5 31 pubnub_await() is not.
sveljko 0:243e0d70a1d5 32 */
sveljko 0:243e0d70a1d5 33
sveljko 0:243e0d70a1d5 34
sveljko 0:243e0d70a1d5 35 /** Waits, in a loop, for the current transaction to finish. */
sveljko 0:243e0d70a1d5 36 enum pubnub_res pubnub_await(pubnub_t *p);
sveljko 0:243e0d70a1d5 37
sveljko 0:243e0d70a1d5 38
sveljko 0:243e0d70a1d5 39 #endif /* defined INC_PUBNUB_NTF_CONTIKI */