Accessory Agent Service D22/Q3
Last updated
Last updated
The D22 device can establish a USB connection with the Q3, where D22 operates in master mode and Q3 in slave mode. The AccessoryConnectionAgent APK facilitates communication between applications across these two devices using Intents sent through the USB connection.
For detailed instructions on how to use the Accessory Connection Agent service, refer to the Accessory Connection Agent service user manual.
Demo for APK Development:
Explore the demo for insights into developing APKs for this setup, Access AccessoryAgentDemo.
Testing APK:
After installation and running this APK, it will send an intent via the USB connection to initiate the merchant self-test application on the other device, .
Sender snippet code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
Receiver(com.wizarpos.accessoryreceiveintentdemo) snippet code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Receive intent data
String extraData = getIntent().getStringExtra("extraData");
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
//Receive intent data
String extraData = intent.getStringExtra("extraData");
}
Installation Requirements:
The AccessoryConnectAgent is typically included in the firmware (FW) of D22 and Q3. For older firmware versions, developers may need to install the agent manually. Download Connection Agent service APK.
Enabling AccessoryConnectionAgent:
By default, the AccessoryConnectionAgent is disabled. Developers can use the provided APK to enable it.
For production firmware, the agent is initialized before factory release.
for D22 and Q3.
Mode Selection:
In Q3, the default mode is set to slave, while other devices default to master mode.
Usbchannel Switch:
Enable or disable the Accessory Connection Agent service as needed for your development and testing purposes.
Download Initialize APK for D3. Set mode and enable USB connectiong in D3. Initialize APK for Q3, please use the APK describe in Initating USB Connection Mode in Development.
Testing APK. Another testing APK, after installation and running this APK, it will send an intent via the USB connection to initiate the initialize application on the other device. This APK can also test between D22 and Q3 too.
Includes two demos, one running in D22, one running in Q3.
This guide provides essential information for developers and users to set up and use the Accessory Agent Service between D22 and Q3 devices, ensuring efficient and effective communication and testing.
If you are looking for more solutions, please refer to: