 
	
You are here: Forum Home → ANT Developers Forums → ANT in Mobile Phones → Thread
15 October 2014 10:21 AM
16 October 2014 12:38 AM #1
20 October 2014 09:20 AM #2
29 October 2014 09:36 PM #3
//Establishing a Channel (Pg. 21 of ANT Message and Protocol 5.1)
 //Unassign Channel, just to be sure
 data[0] = 0x41; //DATA  (Unassign Channel)
 data[1] = 0x01; //DATA  (Channel Number)
 ANT_SendPacket(data, 4);
 //Assign Channel (type 0x10, 0x30, or 0x50)
 data[0] = 0x42; //MSG ID (Assign Channel)
 data[1] = 0x01; //DATA  (Channel Number)
 data[2] = 0x20; //DATA  (Channel Type)
 data[3] = 0x00; //DATA  (Network Number)
 ANT_SendPacket(data, 4);
 //Set Channel ID (Device#=1, Device type=1, Tran' type=1, Chan type = 0x10)
 data[0] = 0x51; //MSG ID (Set Channel ID)
 data[1] = 0x01; //DATA  (Channel Number)
 data[2] = 0x03; //DATA  (Device Number LSB)
 data[3] = 0x00; //DATA  (Device Number MSB)
 data[4] = 0x03; //DATA  (Device Type)
 data[5] = 0x03; //DATA  (Transmission type)
 ANT_SendPacket(data, 6);
 //ANT_SendPacket(data, 5);
 
 //Set Channel PERIOD
 data[0] = 0x43; //MSG ID (Set Channel ID)
 data[1] = 0x01; //DATA  (Channel Number)
 data[3] = 0x40; //DATA  (Channel Period LSB)
 data[2] = 0x00; //DATA  (Channel Period MSB)
 ANT_SendPacket(data, 4);
 
 //Open Channel
 data[0] = 0x4B; //MSG ID (Open Channel)
 data[1] = 0x01; //DATA  (Channel = 1)
 ANT_SendPacket(data, 2); 
// The device type and transmission type to be part of the channel ID message
    private static final int CHANNEL_PROOF_DEVICE_TYPE = 0x03;
    private static final int CHANNEL_PROOF_TRANSMISSION_TYPE = 3;
    
    // The period and frequency values the channel will be configured to
    private static final int CHANNEL_PROOF_PERIOD = 16384; // 2 Hz
    private static final int CHANNEL_PROOF_FREQUENCY = 66; 
29 October 2014 10:54 PM #4
30 October 2014 08:34 AM #5
30 October 2014 11:20 AM #6
30 October 2014 04:35 PM #7
30 October 2014 08:20 PM #8
Ddf.rathb - 30 October 2014 11:20 AM
I want to make the AP2 the slave, and the phone as the shared channel master. with 2 address bytes. I may be misunderstanding, but I thought the phone was configured as a master when I switch the app to Rx mode? The device type is tied to the isMaster, and I was unable to find the code to set isMaster. There is the trivial manually setting it, but I wanted to keep the code "in tact" for reference and robustness.
30 October 2014 10:40 PM #9
1 of 1 Pages
