no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | cybiko:undocumentedsdk [2009/11/27 17:54] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======RF====== | ||
+ | =====Power Adjustment===== | ||
+ | The following calls allow the RF power of the cybiko to be adjusted. | ||
+ | *1 = High power | ||
+ | *0 = Low power | ||
+ | <code c> | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | Interestingly, | ||
+ | |||
+ | |||
+ | |||
+ | =====Other Calls===== | ||
+ | <code c> | ||
+ | __cyos 1340 long get_gate_cyid (void); | ||
+ | __cyos 716 int get_rfchannel (void); | ||
+ | __cyos 707 char* get_ping_listener (void); | ||
+ | __cyos 1141 void set_ping_listener (char * app_name); | ||
+ | __cyos 1039 void reset_ping_listener (char * app_name); | ||
+ | __cyos 1150 void set_rfchannel (int no); | ||
+ | __cyos 718 bool get_server_mode (void); | ||
+ | __cyos 1152 void set_server_mode (bool enable); | ||
+ | __cyos 1341 bool is_gate_visible (void); | ||
+ | __cyos 1269 void update_rf_time (void); | ||
+ | </ | ||
+ | |||
+ | |||
+ | ======Battery Charge====== | ||
+ | |||
+ | You can use this functions for obtaining battery charge: | ||
+ | |||
+ | <code c> | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Define this function prototypes in your program and call them. | ||
+ | More correct way is in the example: | ||
+ | |||
+ | <code c> | ||
+ | # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | int main() | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | But if you want to get batteries charge in millivolts define function | ||
+ | <code c> | ||
+ | | ||
+ | </ | ||
+ | and use the same way as function get_battery_charge(). | ||
+ | |||
+ | ======Setting Alarms====== | ||
+ | |||
+ | Define and use functions: | ||
+ | <code c> | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | ======Signal Strength====== | ||
+ | |||
+ | Message has been sended by deliver method in contrast to post method must be delivered to another Cybiko in the fixed timeout. But post method is faster and good in pinging. send_msg() function sends a message to another application in the same Cybiko computer using local message queue. | ||
+ | |||
+ | There are two types of channels numbering. First is for low level close to hardware. Total sum of these channels is 64 numbered from 0 to 63. This number included in every frame put on the air. Another numbering of the same channels starts from 1 for debugging radio part created several programs. It is " | ||
+ | |||
+ | For those applications that have not specialized channels there are special groups of channels: for games - RF_GROUP_GAMES, | ||
+ | <code c> | ||
+ | | ||
+ | </ | ||
+ | Number of channel in the group can be obtained from function byte_t get_group_size(byte_t group). However the most proper method is to request CyOS to set the least busy channel from the certain group by calling function byte_t set_best_appchannel(byte_t group). Order of two cyiko device transition to separate channel can be following: two devices are taking part - one starts the game: M (master), another answers with agree: | ||
+ | S (slave). | ||
+ | * Located on the base channel (appchannel(0)). | ||
+ | * M: send invitation (select_partner()) and with the aid of it determine CyID of the opponent S. | ||
+ | * M: switch to separated channel by calling set_best_appchannel( RF_GROUP_GAMES ). | ||
+ | * M: send S message that it is time to change channel too. | ||
+ | * S: when receive message change channel by calling function | ||
+ | <code c> | ||
+ | set_appchannel(get_appchannel_of(master_cyid)) | ||
+ | </ | ||
+ | * Start transmission. | ||
+ | |||
+ | The question is that on the step 4 device M know (remember) on what channel device S is situated. Device S just after receiving message from M will know on what channel device M is switched and will change channel to it. | ||
+ | |||
+ | Our device has half-duplex transmit-receiver. In the same time it can receive or send using one frequency. Therefore " | ||
+ | |||
+ | To measure signal strength define function: | ||
+ | <code c> | ||
+ | | ||
+ | </ | ||
+ | Returns device' | ||
+ | RSSI - Received Signal Strength Indicator. Result is in range 0..100. | ||
+ | |||
+ | |||
+ | |||
+ | ======Serial Console I/O====== | ||
+ | |||
+ | //From a note of groups.yahoo.com// | ||
+ | We suspect that the comport.dl is perhaps the cause of leaks/ | ||
+ | It also used the comport.dl. If you | ||
+ | are thinking of making a console app you might also note there are | ||
+ | several undocumented functions for communicating with the console. The | ||
+ | prototypes are in the sdk header files. They are: | ||
+ | <code c> | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | You wouldn' | ||
+ | used themselves used." | ||
+ | <note classic> | ||
+ | These functions are used to send information to the cybiko console, which is itself a serial application. | ||
+ | </ | ||
+ | {{tag> |