Global Lender
A Pebble app for finding new and interesting loans on kiva.org
Data Structures | Typedefs | Enumerations | Functions
comm.h File Reference
#include "data/KivaModel.h"
Include dependency graph for comm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CommHandlers
 

Typedefs

typedef enum MsgKey MsgKey
 
typedef void(* UpdateViewClockHandler) (struct tm *)
 
typedef void(* UpdateViewDataHandler) (const KivaModel *)
 
typedef struct CommHandlers CommHandlers
 

Enumerations

enum  MsgKey {
  KEY_PEBKIT_READY = 0, KEY_PEBBLE_READY, KEY_GET_LENDER_INFO, KEY_GET_PREFERRED_LOANS,
  KEY_KIVA_COUNTRY_SET = 10, KEY_KIVA_SECTOR_SET, KEY_KIVA_ACTIVITY_SET, KEY_KIVA_FIELD_PARTNER_SET,
  APP_ACHIEVEMENT_SET = 20, KEY_LENDER_ID = 30, KEY_LENDER_NAME, KEY_LENDER_LOC,
  KEY_LENDER_LOAN_QTY, KEY_LENDER_TEAM_SET, KEY_LENDER_COUNTRY_SET, KEY_LENDER_SECTOR_SET,
  KEY_LENDER_ACTIVITY_SET, KEY_LENDER_FIELD_PARTNER_SET, KEY_LENDER_TARGET_LOAN_SET, KEY_LENDER_ACHIEVEMENT_SET,
  KEY_LOAN_SET, KEY_PUT_LOANS_IN_BASKET = 100
}
 

Functions

bool comm_pebkitReady ()
 Returns whether the communication channel is ready for sending. More...
 
void comm_open ()
 Opens communication to PebbleKit and allocates memory. More...
 
void comm_close ()
 Closes communication and frees memory. More...
 
void comm_sendMsgCstr (const MsgKey, const char *payload)
 Send data to PebbleKit. More...
 
void comm_tickHandler (struct tm *tick_time, TimeUnits units_changed)
 Callback for TickTimerService. More...
 
void comm_setHandlers (const CommHandlers)
 Set our callback handlers. More...
 
void comm_getPreferredLoans ()
 Requests PebbleKit to send a list of preferred loans for the lender. More...
 

Typedef Documentation

typedef struct CommHandlers CommHandlers
typedef enum MsgKey MsgKey
typedef void(* UpdateViewClockHandler) (struct tm *)
typedef void(* UpdateViewDataHandler) (const KivaModel *)

Enumeration Type Documentation

enum MsgKey
Enumerator
KEY_PEBKIT_READY 
KEY_PEBBLE_READY 
KEY_GET_LENDER_INFO 
KEY_GET_PREFERRED_LOANS 
KEY_KIVA_COUNTRY_SET 
KEY_KIVA_SECTOR_SET 
KEY_KIVA_ACTIVITY_SET 
KEY_KIVA_FIELD_PARTNER_SET 
APP_ACHIEVEMENT_SET 
KEY_LENDER_ID 
KEY_LENDER_NAME 
KEY_LENDER_LOC 
KEY_LENDER_LOAN_QTY 
KEY_LENDER_TEAM_SET 
KEY_LENDER_COUNTRY_SET 
KEY_LENDER_SECTOR_SET 
KEY_LENDER_ACTIVITY_SET 
KEY_LENDER_FIELD_PARTNER_SET 
KEY_LENDER_TARGET_LOAN_SET 
KEY_LENDER_ACHIEVEMENT_SET 
KEY_LOAN_SET 
KEY_PUT_LOANS_IN_BASKET 

Function Documentation

void comm_close ( )

Closes communication and frees memory.

void comm_getPreferredLoans ( )

Requests PebbleKit to send a list of preferred loans for the lender.

void comm_open ( )

Opens communication to PebbleKit and allocates memory.

bool comm_pebkitReady ( )

Returns whether the communication channel is ready for sending.

void comm_sendMsgCstr ( const MsgKey  ,
const char *  payload 
)

Send data to PebbleKit.

void comm_setHandlers ( const CommHandlers  )

Set our callback handlers.

void comm_tickHandler ( struct tm *  tick_time,
TimeUnits  units_changed 
)

Callback for TickTimerService.