Overview
The reader can report which interface it is connected through. An application receives this information as an event. Subscribe to the connected interface event with srfidSubsribeForEvents: and the SRFID_EVENT_MASK_CONNECTED_INTERFACE mask, then read the interface type in the srfidEventConnectedInterfaceNotity: delegate method.
Subscribe to connected interface events
The srfidSubsribeForEvents: method with the SRFID_EVENT_MASK_CONNECTED_INTERFACE mask subscribes the application to connected interface events.
//Event subscribe:
[apiInstance srfidSubsribeForEvents:(SRFID_EVENT_MASK_CONNECTED_INTERFACE)];
Handle the connected interface event
The srfidEventConnectedInterfaceNotity:aConnectedInterfaceEvent: delegate method receives an sfidConnectedInterfaceEvent object. Call getConneted_Interface_Type on it to get the interface type. The type is one of the following SRFID_CONNECTED_INTERFACE_TYPE values:
SRFID_CONNECTION_TYPE_NO_INTERFACESRFID_CONNECTION_TYPE_TERMINALSRFID_CONNECTION_TYPE_USBSRFID_CONNECTION_TYPE_ETHERNETSRFID_CONNECTION_TYPE_BLUETOOTH
//Event:
- (void)srfidEventConnectedInterfaceNotity:(int)readerID aConnectedInterfaceEvent:(sfidConnectedInterfaceEvent*)connectedInterfaceEvent
{
SRFID_CONNECTED_INTERFACE_TYPE interfaceType = [connectedInterfaceEvent getConneted_Interface_Type];
NSLog(@"\nUserInterFace for Connection:(%u)\n", interfaceType);
if (SRFID_CONNECTION_TYPE_BLUETOOTH == interfaceType) {
NSLog(@" Bluetooth Connection");
}
else if (SRFID_CONNECTION_TYPE_USB == interfaceType) {
NSLog(@" USB Connection");
}
else if (SRFID_CONNECTION_TYPE_NO_INTERFACE == interfaceType) {
NSLog(@" NO_INTERFACE Connection");
}
else if (SRFID_CONNECTION_TYPE_ETHERNET == interfaceType) {
NSLog(@" Ethernet Connection");
}
else if (SRFID_CONNECTION_TYPE_TERMINAL == interfaceType) {
NSLog(@" Terminal Connection");
}
}