CallsUssd

CallsUssd — An interface for handling USSD

Functions

Signals

void ussd-added Run Last
void ussd-cancelled Run Last
void ussd-state-changed Run Last

Types and Values

Object Hierarchy

    GEnum
    ╰── CallsUssdState
    GInterface
    ╰── CallsUssd

Prerequisites

CallsUssd requires GObject.

Description

Functions

calls_ussd_get_state ()

CallsUssdState
calls_ussd_get_state (CallsUssd *self);

calls_ussd_initiate_async ()

void
calls_ussd_initiate_async (CallsUssd *self,
                           const char *command,
                           GCancellable *cancellable,
                           GAsyncReadyCallback callback,
                           gpointer user_data);

calls_ussd_initiate_finish ()

char *
calls_ussd_initiate_finish (CallsUssd *self,
                            GAsyncResult *result,
                            GError **error);

calls_ussd_respond_async ()

void
calls_ussd_respond_async (CallsUssd *self,
                          const char *response,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

calls_ussd_respond_finish ()

char *
calls_ussd_respond_finish (CallsUssd *self,
                           GAsyncResult *result,
                           GError **error);

calls_ussd_cancel_async ()

void
calls_ussd_cancel_async (CallsUssd *self,
                         GCancellable *cancellable,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

calls_ussd_cancel_finish ()

gboolean
calls_ussd_cancel_finish (CallsUssd *self,
                          GAsyncResult *result,
                          GError **error);

Types and Values

CALLS_TYPE_USSD

#define CALLS_TYPE_USSD (calls_ussd_get_type ())

enum CallsUssdState

Members

CALLS_USSD_STATE_UNKNOWN

   

CALLS_USSD_STATE_IDLE

   

CALLS_USSD_STATE_ACTIVE

   

CALLS_USSD_STATE_USER_RESPONSE

   

struct CallsUssdInterface

struct CallsUssdInterface {
  GTypeInterface parent_iface;

  CallsUssdState (*get_state)       (CallsUssd *self);
  void           (*initiate_async)  (CallsUssd          *self,
                                     const char         *command,
                                     GCancellable       *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer            user_data);
  char          *(*initiate_finish) (CallsUssd    *self,
                                     GAsyncResult *result,
                                     GError      **error);
  void           (*respond_async)    (CallsUssd          *self,
                                      const char         *response,
                                      GCancellable       *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer            user_data);
  char          *(*respond_finish)   (CallsUssd    *self,
                                      GAsyncResult *result,
                                      GError      **error);
  void           (*cancel_async)     (CallsUssd          *self,
                                      GCancellable       *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer            user_data);
  gboolean       (*cancel_finish)    (CallsUssd    *self,
                                      GAsyncResult *result,
                                      GError      **error);
};

CallsUssd

typedef struct _CallsUssd CallsUssd;

Signal Details

The “ussd-added” signal

void
user_function (CallsUssd *self,
               char      *response,
               gpointer   user_data)

Emitted when some USSD response is recieved

Parameters

self

a CallsUssd

 

response

a string

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “ussd-cancelled” signal

void
user_function (CallsUssd *self,
               gpointer   user_data)

Emitted when the active USSD is cancelled. Shouldn't be emitted if cancelled to immidiately request again.

Parameters

self

a CallsUssd

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “ussd-state-changed” signal

void
user_function (CallsUssd *self,
               gpointer   user_data)

Emitted when the USSD state changes. Use calls_ussd_get_state() to get the state.

Parameters

self

a CallsUssd

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last