For the compiler you are quite right, it shall be fixed in future, so don\'t care.
In order change the default radio channel, which is 26, you can use the this compiler directive
-DOPENZB_CHANNEL=25; in this example I selected channel 25.
You can set this in the .oil (here there\'s an example).
Code: Select all
CPU mySystem {
OS myOs {
LIB = ENABLE { NAME = "ieee802154"; };
CFLAGS = "-DDEVICE_TYPE_COORDINATOR";
CFLAGS = "-DOPENZB_CHANNEL=25";
};
};
Now let\'s go the GTS problem.
Since the 802.15.4 stack has been released in preliminary version the GTS allocation mechanism is statically implemented in the library source code.
To allocate GTS you should modify the Mac.c file in the ieee 802.15.4 library path.
So open the file
evidence_root_dir/ee/contrib/ieee802154/libsrc/mac/Mac.C, where
evidence_root_dir is tipically
c:\\Evidence\\Evidence, end change the
init_mac() function in the section reported below.
Code: Select all
#ifdef DEVICE_TYPE_COORDINATOR
init_GTS_db();
init_GTS_null_db();
init_gts_slot_list();
init_available_gts_index();
//add_gts_entry(4,1,0x1234,7);
//add_gts_entry(4,0,0x0002,7);
add_gts_entry(1,1,0x1234,11);
add_gts_entry(1,0,0x0002,11);
#endif
You can explicitly specify the allocation of the GTSs by means of the
add_gts_entry() function.
The usage of the function is:
add_gts_entry(gts_length, direction, dest_address, start_slot_index)
[ul]
[*] gts_length: Number of slots to allocate (max 15)
[*] direction: 0=send, 1=receive
[*] dest_address: destination address
[*] start_slot_index: starting slot for the allocation of the GTSs (from 1 to 15)
[/ul]
NOTE:
[ul]
[*]The
start_slot_index is a test parameter, sorry :( ,and it shall be removed in future. Set this so that the
gts_length does not overflow the 15th slot.
[*]The addresses are statically defined in the source code: 0x1234 is the coordinator, 0x0002 is the device.
[*]The allocation of the GTS must be done for both transmission and reception.
[/ul]
Let\'s consider the example above to make it clear.
Code: Select all
add_gts_entry(1,1,0x1234,11);
add_gts_entry(1,0,0x0002,11);
The first line allocate one GTS in reception mode for the coordinator in the 11th slot, the second line allocate the same GTS in transmission mode for the coordinator.
Don\'t forget that to send in GTS mode you have to set to one the last parameter in the
openZB_send_bytes() function.
I hope that\'s will help you.
Regards,
Christian.