@@ -86,13 +86,14 @@ bool test_tr51_get_uc_channel_index()
86
86
int i ;
87
87
uint16_t number_of_channels = 129 ;
88
88
int32_t channel ;
89
- int16_t channel_table [number_of_channels ];
89
+ int16_t channel_table [number_of_channels + 10 ];
90
+ uint8_t output_table [number_of_channels ];
90
91
int32_t test_table [number_of_channels ];
91
92
uint8_t mac [8 ] = {0x00 , 0x13 , 0x50 , 0x04 , 0x00 , 0x00 , 0x05 , 0xf8 };
92
93
93
94
tr51_init_channel_table (channel_table , number_of_channels );
94
95
for (i = 0 ; i < number_of_channels ; i ++ ) {
95
- test_table [i ] = channel = tr51_get_uc_channel_index (channel_table , i , mac , number_of_channels , NULL );
96
+ test_table [i ] = channel = tr51_get_uc_channel_index (channel_table , output_table , i , mac , number_of_channels , NULL );
96
97
// Not sure yet which one is correct since there might be bug in spec
97
98
// if (channel != test_HopSequenceTable[i]) {
98
99
if (channel != test_HopSequenceTable2 [i ]) {
@@ -117,7 +118,7 @@ bool test_tr51_get_uc_channel_index()
117
118
uint32_t excluded_channels [8 ] = {0x40100401 , 0x10040100 , 0x04010040 , 0 , 0 , 0 , 0 , 0 };
118
119
uint16_t number_of_excluded_channels = 10 ;
119
120
for (i = 0 ; i < number_of_channels - number_of_excluded_channels ; i ++ ) {
120
- test_table [i ] = channel = tr51_get_uc_channel_index (channel_table , i , mac , number_of_channels , excluded_channels );
121
+ test_table [i ] = channel = tr51_get_uc_channel_index (channel_table , output_table , i , mac , number_of_channels , excluded_channels );
121
122
// Shouldn't find channel from excluded channels
122
123
if (channel_on_the_list (excluded_channels , channel )) {
123
124
return false;
@@ -140,10 +141,11 @@ bool test_tr51_get_bc_channel_index()
140
141
int32_t channel ;
141
142
uint16_t bsi = 100 ;
142
143
int32_t test_table [number_of_channels ];
143
- int16_t channel_table [number_of_channels ];
144
+ int16_t channel_table [number_of_channels + 10 ];
145
+ uint8_t output_table [number_of_channels ];
144
146
tr51_init_channel_table (channel_table , number_of_channels );
145
147
for (int i = 0 ; i < number_of_channels ; i ++ ) {
146
- test_table [i ] = channel = tr51_get_bc_channel_index (channel_table , i , bsi , number_of_channels , NULL );
148
+ test_table [i ] = channel = tr51_get_bc_channel_index (channel_table , output_table , i , bsi , number_of_channels , NULL );
147
149
if (channel != test_HopSequenceTable3 [i ]) {
148
150
return false;
149
151
}
0 commit comments