![]() |
ResponseHandler is used to notify calling applications of responses from an IDBLUE device. Calling applications should create a subclass of ResponseHandler, and pass the ResponseHandler subclass into the methods of IDBlueCommandSender.
For example, here's an example of the beepAsync command
// Myhandler.h }
// Myhandler.m Myhandler // Override beepResponse to process successsful beep responses -(void) beepResponse: (IDBlueCommand*) command withResponse: (IDBlueResponse*) response { // TODO - beep succeeded }
// Override beepFailed to process failed beep response -(void) beepFailed: (IDBlueCommand*) command withResponse: (NackResponse*) response { // TODO - beep failed }
// SomeFile.m -(void) beep { IDBlueCommandSender* controller; // TODO - initialize Myhandler* handler; // TODO - initialize BeepType bt = BT_Low; SendStatus* status = [controller beepAsync: bt withHandler: handler]; if ([status successful]) { // Beep command sent successfully } else { // Beep failed } }