The MFi communication library is a library for communicating with Apple's iOS devices via Bluetooth, and uses the MFi / iAP2 / External Accessory protocol.

MFi accessory information

The accessory information of OPH-5000i registered in the MFi Program is as follows.
  • Accessory name: Wireless Barcode Scanner
  • Model Number: OPH-5000i
  • iAP protocol: iAP2
  • iAP features: EA iAP2 Session
  • Accessory hardware: Bluetooth Classic
  • External Accessory protocol: jp.opto.opnprotocol

Apple device app development

Data communication between OPH-5000i (MFi accessory) and the application of Apple device requires ExternalAccessory.framework of Apple Inc. See External Accessory Framework for more information.
The iOS library uses ExternalAccessory.framework to communicate with OPH-5000i (MFi accessory).
For information on how to use the iOS library (OPHBluetoothService.framework), see iOS library and iOS Methods.
You also need to add Supported external accessory protocols to your application's Info.plist and specify jp.opto.opnprotocol.
See iOS Application Development for Xcode development.

Distribution to the App Store

To distribute an application that connects to the OPH-5000i MFi accessory from the App Store, it is necessary to register the software information from the manufacturer of the MFi certified device (our company) to Apple Inc. There is a need.
Distribution via Ad hoc or Enterprise does not require registration.
Please contact us if you need distribution on the App Store.

OPH-5000i communication port

Bluetooth MFi communication (SPP / Master, SPP / Slave) is performed on the following ports respectively.
  • COM3: SPP / Master
  • COM5: SPP / Slave

OPH-5000i communication settings

Bluetooth communication conditions can be set using the SetConfig function .
The setting becomes effective when the communication port is closed and then reopened.
Sample
  
  • COM3 : SPP/Master setconfig_comapi spp_cfg; SetDefault(COM3); strncpy((char *)spp_cfg.blt.address, bdAddress, BLT_BD_ADDR_LEN); spp_cfg.blt.iPhoneMode = ENABLE_IPHONE_MODE_SPP_MASTER; SetConfig(port, (void *)&spp_cfg);
  • COM5 : SPP/Slave setconfig_comapi spp_cfg; SetDefault(COM5); // DISABLE:Do pairing / ENABLE:Reconnect preview paring device spp_cfg.blt.pairedDeviceConnect = DISABLE; spp_cfg.blt.iPhoneMode = ENABLE_IPHONE_MODE_SPP_SLAVE; SetConfig(port, (void *)&spp_cfg);
  • How to use


    (Caution)
      Please note that you cannot use multiple
    • ports at the same time.
    • Even if you change the settings of the open communication port, the changes will not be reflected immediately.
    • While the Bluetooth communication port is open, battery consumption will increase compared to normal times, so it is recommended to close it when not necessary.
    • In the API for communication, please do not open two COMs at the same time, but be sure to open a new COM after closing it.
    • If you are using Bluetooth MFi communication, you cannot use the following communication function.
      PutCom function, putnstr function, PutString function, comloc function
    • The iAP protocol in which OPH-5000i is implemented is the iAP2 protocol.
      iAP1 protocol is not supported.
    • Please use GetCom function for reception on the OPH-5000i side.
      Due to the accessory interface specifications, the maximum length of the External Accessory Protocol message that the OPH-5000i MFi accessory can receive from the iOS device is 2036 bytes.

    Related matters



    Last updated: 2022/05/09