dsctl-devel Mailing List for Dsctl - Digital scanner control program
Status: Alpha
Brought to you by:
roger-linux
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(59) |
Jul
(76) |
Aug
(1) |
Sep
|
Oct
|
Nov
(5) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <rog...@us...> - 2008-09-28 23:09:22
|
Revision: 144 http://dsctl.svn.sourceforge.net/dsctl/?rev=144&view=rev Author: roger-linux Date: 2008-09-28 23:09:15 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Adding ices /etc/conf.d/* files with the needed customizations to make Ices work with DSctl (for documentation reasons). Added Paths: ----------- utils/ices utils/ices-alsa.xml Added: utils/ices =================================================================== --- utils/ices (rev 0) +++ utils/ices 2008-09-28 23:09:15 UTC (rev 144) @@ -0,0 +1,21 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need icecast net + use dns +} + +start() { + ebegin "Starting ices" + start-stop-daemon --start --quiet --chuid roger --exec /usr/bin/ices \ + -- /etc/ices2/ices-alsa.xml + eend $? +} + +stop () { + ebegin "Stopping ices" + start-stop-daemon --stop --retry 5 --quiet --exec /usr/bin/ices + eend $? +} Property changes on: utils/ices ___________________________________________________________________ Added: svn:executable + * Added: utils/ices-alsa.xml =================================================================== --- utils/ices-alsa.xml (rev 0) +++ utils/ices-alsa.xml 2008-09-28 23:09:15 UTC (rev 144) @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<ices> + + <!-- run in background --> + <background>1</background> + <!-- where logs go. --> + <logpath>/var/log/ices</logpath> + <logfile>ices.log</logfile> + <!-- size in kilobytes --> + <logsize>2048</logsize> + <!-- 1=error, 2=warn, 3=infoa ,4=debug --> + <loglevel>2</loglevel> + <!-- logfile is ignored if this is set to 1 --> + <consolelog>0</consolelog> + + <!-- optional filename to write process id to --> + <!-- <pidfile>/home/ices/ices.pid</pidfile> --> + + <stream> + <!-- metadata used for stream listing --> + <metadata> + <name>BCD996T</name> + <genre>Scanner</genre> + <description>Eugene, Oregon: Police, Fire, EMS </description> + <url> http://67.171.224.16:8000/</url> + </metadata> + + <!-- Input module. + + This example uses the 'oss' module. It takes input from the + OSS audio device (e.g. line-in), and processes it for live + encoding. --> + <input> + <module>alsa</module> + <param name="rate">44100</param> + <param name="channels">2</param> + <param name="device">hw:0,0</param> + <!-- Read metadata (from stdin by default, or --> + <!-- filename defined below (if the latter, only on SIGUSR1) --> + <param name="metadata">1</param> + <param name="metadatafilename">/home/roger/.dsctl/metadata</param> + </input> + + <!-- Stream instance. + + You may have one or more instances here. This allows you to + send the same input data to one or more servers (or to different + mountpoints on the same server). Each of them can have different + parameters. This is primarily useful for a) relaying to multiple + independent servers, and b) encoding/reencoding to multiple + bitrates. + + If one instance fails (for example, the associated server goes + down, etc), the others will continue to function correctly. + This example defines a single instance doing live encoding at + low bitrate. --> + + <instance> + <!-- Server details. + + You define hostname and port for the server here, along + with the source password and mountpoint. --> + + <hostname>localhost</hostname> + <port>8000</port> + <password>rogerroger</password> + <mount>/bcd996t.ogg</mount> + <yp>1</yp> <!-- allow stream to be advertised on YP, default 0 --> + + <!-- Live encoding/reencoding: + + channels and samplerate currently MUST match the channels + and samplerate given in the parameters to the oss input + module above or the remsaple/downmix section below. --> + + <encode> + <quality>0</quality> + <samplerate>22050</samplerate> + <!-- <samplerate>44100</samplerate> --> + <channels>1</channels> + </encode> + + <!-- stereo->mono downmixing, enabled by setting this to 1 --> + <downmix>1</downmix> + + <!-- resampling. + + Set to the frequency (in Hz) you wish to resample to, --> + + <resample> + <in-rate>44100</in-rate> + <out-rate>22050</out-rate> + </resample> + </instance> + + </stream> +</ices> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-11-14 04:00:19
|
Revision: 143 http://dsctl.svn.sourceforge.net/dsctl/?rev=143&view=rev Author: roger-linux Date: 2007-11-13 19:59:32 -0800 (Tue, 13 Nov 2007) Log Message: ----------- src/commands.c src/commands.h - Finished writing functions for all commands. Corrected comments for reading clarity. TODO: Implement remainder of functions. TODO: Cleanup command line interface and output. Modified Paths: -------------- src/commands.c src/commands.h Modified: src/commands.c =================================================================== --- src/commands.c 2007-11-12 22:07:47 UTC (rev 142) +++ src/commands.c 2007-11-14 03:59:32 UTC (rev 143) @@ -909,7 +909,7 @@ /*********************************************************************** * Delete System ***********************************************************************/ -/* TODO: This needs to be implemented & tested */ +/* TODO: If needed, this needs to be implemented & tested */ int delete_system(int fd, int system_index) { char answer[100], command[500]; @@ -1739,7 +1739,7 @@ /*********************************************************************** * Get Locked Out TGIDs ***********************************************************************/ -/* TODO - Check GLI info is downloading. It seems to work. */ +/* TODO: This needs to be tested. I think it works. */ int get_lockout_tgid(int fd, int system_index) { char answer[100], command[100]; @@ -1782,7 +1782,7 @@ /*********************************************************************** * Get Search Lockout TGID ***********************************************************************/ -/* TODO - Check SLI info is downloading. It seems to work. */ +/* TODO: This needs to be tested. It seems to work. */ int get_search_lockout_tgid(int fd, int system_index) { char answer[100], command[100]; @@ -2004,7 +2004,6 @@ /*********************************************************************** * Get Location Alert System Index Head ***********************************************************************/ -/* TODO: This needs to be implemented & tested */ int loc_alert_system_index_head(int fd, char *loc_alert_system_type) { char answer[100], command[100]; @@ -2121,7 +2120,7 @@ snprintf(command, 100, "LIN,%i", loc_alert_system_index); /*printf("Command == %s\n", command); */ do_command(fd, command, answer); - /*printf ("\n%s\n(%i)\n", answer, strlen (answer)); */ + printf ("\n%s\n(%i)\n", answer, strlen (answer)); parse_fields(answer, field); /* We have 13 parsed fields to print for this command */ @@ -3438,12 +3437,6 @@ get_firmware_version(fd); - get_opening_message(fd); - - get_remains_memory_block(fd); - - get_memory_used(fd); - /* Get System Settings */ get_backlight(fd); @@ -3457,39 +3450,7 @@ get_system_count(fd); - get_srch_cc_settings(fd); - - get_bcast_screen_band_settings(fd); - - get_search_key_settings(fd); - - get_global_lockout_freq(fd); - - get_close_call_settings(fd); - - get_service_search_settings(fd); - - get_custom_search_group(fd); - - get_custom_search_settings(fd); - - get_weather_settings(fd); - - get_same_group_settings(fd); - - get_tone_out_settings(fd); - - get_lcd_contrast_settings(fd); - - get_lcd_upside_down_settings(fd); - - get_scanner_option_settings(fd); - - get_apco_settings(fd); - - get_gps_display_option(fd); - - /* Get Scan Settings + /* Scan Settings * The "scan data" is organized into two basic trees. One for * conventional freqs and the other tree organized for trunked freqs. * I ordered the function calls below into a very particular order @@ -3497,24 +3458,26 @@ * gotten the data once. Why make a second call to the scanner when we * already have the data?) */ - /* SIN - * While we have System Indexes, then print them. - * using the above System Head and System Tail + /* While we have System Indexes, then print them. + * (Using the System Head and System Tail.) * And once we find the first system, find the next system using * forward system index field. - * TODO: When we get SIN, create a new out-file named for each SIN name */ + * TODO: When we get SIN, create a new out-file named for each SIN name? */ sys_index = get_system_index_head(fd); - /* Get System Quick Lockouts now */ + /* QSL + * Get System Quick Lockouts now */ get_system_quick_lockout(fd); while (sys_index != -1) { - /* Get Group Quick Lockouts now along with System Info */ + /* QGL + * Get Group Quick Lockouts */ get_group_quick_lockout(fd, sys_index); - /* Continue getting System Info */ + /* SIN + * Continue getting System Info */ char channel_group_head[10]; int next_sys_index = 0; @@ -3530,8 +3493,8 @@ /*printf("systype = %s\n", sys_type); */ /*printf("sys_index = %i\n", sys_index); */ - /* TRN */ - /* While System has Trunked Systems, then print them. + /* TRN + * While System has Trunked Systems, then print them. * * Set our grpinfo variable before getting site info because * these are pointers and site info will overwrite it's @@ -3546,8 +3509,8 @@ && strncmp(sys_type, "LTR", 3) != 0) grpinfo_index = get_trunk_info(fd, sys_index); - /* GIN */ - /* While System has Groups, then print them. + /* GIN + * While System has Groups, then print them. * * grpinfo_index was set prior to getting Site Info because * we're returning pointers from parse_fields */ @@ -3564,8 +3527,8 @@ chaninfo_index = atoi(channel_index); tgidinfo_index = chaninfo_index; - /* CIN */ - /* While Group has Channels, and System Type is Conventional, then print them. + /* CIN + * While Group has Channels, and System Type is Conventional, then print them. * Else they're treated like Trunk Group ID's. */ /*printf(" (Channel Starting Location: %s Channel Ending Location: %s)\n", grp_field[8], grp_field[9]; */ int next_channel_index = 0; @@ -3587,8 +3550,8 @@ chaninfo_index = next_channel_index; } - /* TIN */ - /* While system is not conventional, then get Trunk Group ID info. */ + /* TIN + * While system is not conventional, then get Trunk Group ID info. */ /*printf(" (TGID Starting Location: %s TGID Ending Location: %s)\n", tgid_field[8], tgid_field[9]; */ /*printf("systype = %s\n", sys_type); */ int next_tgidinfo_index = 0; @@ -3604,8 +3567,9 @@ tgidinfo_index = next_tgidinfo_index; } - /* GLI & SLI */ - /* If a system is not conventional, then get all L/O TGIDs and Search L/O TGIDs for the System */ + /* GLI & SLI + * If a system is not conventional, then get all L/O + * TGIDs and Search L/O TGIDs for the System */ if (strncmp(sys_type, "CNV", 3) != 0 && strncmp(sys_type, "LTR", 3) != 0) { get_lockout_tgid(fd, sys_index); @@ -3613,8 +3577,8 @@ } } - /* SIF */ - /* While System has Sites, print them. + /* SIF + * While System has Sites, print them. * We only get Site Info (aka Site Settings), as well as TFQ, * if the System is not Conv Type * @@ -3681,52 +3645,60 @@ } } - /* Exit from Programming Mode */ + get_remains_memory_block(fd); + get_memory_used(fd); + + /* Search/Close Call Settings */ + get_srch_cc_settings(fd); + + get_bcast_screen_band_settings(fd); + + get_search_key_settings(fd); + + get_global_lockout_freq(fd); + + get_close_call_settings(fd); + + /* Misc Settings */ + get_service_search_settings(fd); + + get_custom_search_group(fd); + + get_custom_search_settings(fd); + + get_weather_settings(fd); + + get_same_group_settings(fd); + + get_tone_out_settings(fd); + + get_lcd_contrast_settings(fd); + + get_lcd_upside_down_settings(fd); + + get_scanner_option_settings(fd); + + get_apco_settings(fd); + + /* GPS Settings */ + get_gps_display_option(fd); + + /* Exit Programming Mode */ exit_prg_mode(fd); return (0); } -/*********************************************************************** -* Load Firmware -***********************************************************************/ -int load_firmware(int fd, FILE *infile) -{ - char line[500]; - - memset(line, 0, 500); - - printf("firmware_load: \n"); - - setup_port(fd, 9600); /* Units use default baud rates in firmware mode! */ - //get_fmodel(fd, model); /* "*MDL" */ - - //if (strcmp(model, "bcd996t") == 0) - //{ - // set_speed(fd, 115200); /* "*SPD int" - Increase baud rate to value*/ - // setup_port(fd, 115200); /* Set our program to the increased baud rate */ - // set_pgl(fd, 1000000000000000000); /* "*PGL int" - Clear Memory ??? */ - // set_ule(fd); /* "*ULE" - Unlock EEPROM ??? */ - // set_scb(fd, 1); /* "*SCB int" - Set Checksum Byte to int ??? */ - // set_prg(fd); /* "*PRG" - Enter program mode - expect a lot of data */ - - /* TODO: Put firmware names and checksums into DEFINES */ - while (fgets(line, MAXLINELEN, infile) != NULL) - { - // read in firmware - // When NULL, scanner unit will return "PROGRAM END" and "CHECKSUM= EC8BH - } - - return (0); -} /*********************************************************************** * Load BCD memory from file ***********************************************************************/ /* TODO: Break the following into sections for allowing upload of - *only Configuration Settings, Systems Data only or Location Alert - *Settings only.*/ + * only Configuration Settings, Systems Data only or Location Alert + * Settings only? + * TODO: This only loads Scan Settings. Need to implement the remainder + * of the other commands. */ int load(int fd, FILE * infile) { char answer[500], command[500], line[500], *parsed_line[100], @@ -3779,7 +3751,12 @@ /* TODO: Break the following into sections for allowing upload of only Configuration Settings, Systems Data only or - Location Alert Settings only. */ + Location Alert Settings only? */ + + /* System Settings + * TODO: BKL, KBP, OMS, PRI, AGV */ + + /* Scan Settings */ if (strncmp(scanner_command, "SIN", 3) == 0) { /*printf("DEBUG %s\n", scanner_command); */ @@ -3861,6 +3838,18 @@ /* Set Trunk Frequency info. Send channel_index & string info; Returns OK. */ set_trunk_freq_info(fd, channel_index, parsed_line); } + + /* Location Settings + * TODO: CLA, LIN */ + + /* Search/Close Call Settings + * TODO: SCO, BBS, SHK, CLC -- and LOF too? */ + + /* Misc Settings + * TODO: SSP, CSG, CSP, WXS, SGP, TON, CNT, DUD, SCN -- and P25 too? */ + + /* GPS Settings + * TODO: GDO */ } } @@ -3873,6 +3862,42 @@ } /*********************************************************************** +* Load Firmware +***********************************************************************/ +/* TODO: This needs testing - I have a timeout in serial.c try to detect +communication hangs - I might remove the detection if it's too trouble- +some. Firmware load can take > 5 minutes and might be mistaken for hanging. */ +int load_firmware(int fd, FILE *infile) +{ + char line[500]; + + memset(line, 0, 500); + + printf("firmware_load: \n"); + + setup_port(fd, 9600); /* Units use default baud rates in firmware mode! */ + //get_fmodel(fd, model); /* "*MDL" */ + + //if (strcmp(model, "bcd996t") == 0) + //{ + // set_speed(fd, 115200); /* "*SPD int" - Increase baud rate to value*/ + // setup_port(fd, 115200); /* Set our program to the increased baud rate */ + // set_pgl(fd, 1000000000000000000); /* "*PGL int" - Clear Memory ??? */ + // set_ule(fd); /* "*ULE" - Unlock EEPROM ??? */ + // set_scb(fd, 1); /* "*SCB int" - Set Checksum Byte to int ??? */ + // set_prg(fd); /* "*PRG" - Enter program mode - expect a lot of data */ + + /* TODO: Put firmware names and checksums into DEFINES */ + while (fgets(line, MAXLINELEN, infile) != NULL) + { + // read in firmware + // When NULL, scanner unit will return "PROGRAM END" and "CHECKSUM= EC8BH + } + + return (0); +} + +/*********************************************************************** * Get Scanner Model & Scanner Firmware Version ***********************************************************************/ int version(int fd) Modified: src/commands.h =================================================================== --- src/commands.h 2007-11-12 22:07:47 UTC (rev 142) +++ src/commands.h 2007-11-14 03:59:32 UTC (rev 143) @@ -171,12 +171,12 @@ int get_apco_settings(int fd); int set_apco_settings(int fd, int threshold); -/* GPS Related (Available in Program Mode Only) */ +/* GPS Settings (Available in Program Mode Only) */ /* (Not Tested. I don't have a GPS for this scanner) */ int get_gps_display_option(int fd); int set_gps_display_option(int fd, char **parsed_line); -/* GPS Related (Use not restricted to Program Mode) */ +/* GPS Settings (Use not restricted to Program Mode) */ int get_gps_gga_data(int fd); int get_gps_rmc_data(int fd); int get_window_voltage(int fd); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-11-12 22:07:51
|
Revision: 142 http://dsctl.svn.sourceforge.net/dsctl/?rev=142&view=rev Author: roger-linux Date: 2007-11-12 14:07:47 -0800 (Mon, 12 Nov 2007) Log Message: ----------- src/commands.c - Added: New commands/functions. Fixed: BKL not getting all of it's data. Added: Stubs/comments for future commands/functions. src/commands.c - Added: Completed commands/functions. (Still needs implementing & testing. See commands.c for TODO comments.) src/commands.h - Trivial: Uncommented remainder function names today. (Corrected a few of the newly uncommented functions.) TODO - Trivial: Adjusted comments reflecting work completed today. Modified Paths: -------------- TODO src/commands.c src/commands.h Modified: TODO =================================================================== --- TODO 2007-11-11 21:28:54 UTC (rev 141) +++ TODO 2007-11-12 22:07:47 UTC (rev 142) @@ -1,56 +1,56 @@ 1) Implementing the commands according to the BCD996T_Protocol.pdf is simply the only things left to do besides some bugs - concerning serial communication. Most of the protocol commands, - if not all of them, are located within the commands.c file. + concerning serial communication. Most of the functions for the + commands, if not all of them, are located within the commands.c + file. Work is primarily done for the BCD996T. BCD396T has similar + commands, but no work has currently been done to ensure 100% + compatability. This can be easily done though if somebody has + a BCD396T and some time for submitting bug reports. I've completed almost all the _get_ commands to retrieve data from the units including some of the _set_ commands to send data to the unit. To see what I haven't done yet, look at the - commands.h file for commented function declarations. Obviously, - these are the functions (aka scanner commands) needing - implementing. + commands.c for for TODO comments. Currently, all the commands have + been written into functions, they just need to be further + implemented or hooked into the upper-level load() and dump() + functions. Testing is also needed with these. (*See TODO comments + within commands.c.) - It's quite easy really. You can basically copy/paste over most - of the code within the previous functions according to whether - it's a get_ or set_ command. You just need to either read the - returned comma parsed string into the proper varaibles for - printing. If the command is to _set or send data, again, the - string needs to be read in from file and formated properly before - sending the string to the scanner. + I've even found the undocumented commands for uploading firmware. + Status of these are the same as above, they just need implemented + and testing. - I've even found the commands for uploading firmware. - - The only gotcha, I tried implementing a delay into the serial.c + The only hiccup, I tried implementing a delay into the serial.c with hopes of the program detecting a stall and quiting instead of locking the computer with the system call. You may notice the delay values somewhere between 10 seconds to 45+ seconds for downloading or uploading. For loading the firmware, it can take - more then 5 minutes. + more then 5 minutes. The function in serial.c for checking delays + needs to know these as so not to confuse the time span as a hang. I, or somebody else, might consider re-writing the code once the - functions are implemented for easier reading. Should probably use - structs? + functions are implemented for easier reading. (Should probably use + structs?) - If you look at the protocol pdf file, I'm also missing APPEND - functions. - 2) Some sort of frontend is needed for programming this scanner. There's just too much loose data, requiring specific ranges, etc, for a simple user to enter by hand. I'm up for ideas here. Gnome or ncurses based UI??? Well, I do have autoconfig/automake installed, albeit, roughly. - One method probably doesn't require much of a frontend, direct - downloading for radioreference.com. However, users generally - still have to fill in TGID's after searching for them on an - APCO based system. + One method probably doesn't require much of a frontend is, direct + downloading from radioreference.com. However, users generally + still have to fill in TGID's after searching for them on their + scanned system since some TGID's are not listed. -3) I do have a basic command implemented for Live Streaming via - Icecast. The stream is also updated with the active frequency data. +3) I do have a basic command implemented for Live Streaming to + Icecast. The stream is also updated with the active frequency data + called metadata (ie ~/.dsctl/metadata). There's a bug, after a time period of streaming, the ncurses display will freeze, but it basically works. (Think the - bug/freeze is encountered with certain freq/band is hit.) + bug/freeze is encountered with serial buffering. Could be this code + or something in the kernel.) 4) Future: a) Possible rewrite using structs instead of all arrays and Modified: src/commands.c =================================================================== --- src/commands.c 2007-11-11 21:28:54 UTC (rev 141) +++ src/commands.c 2007-11-12 22:07:47 UTC (rev 142) @@ -2004,7 +2004,7 @@ /*********************************************************************** * Get Location Alert System Index Head ***********************************************************************/ -/* TODO: This needs to be tested/checked. */ +/* TODO: This needs to be implemented & tested */ int loc_alert_system_index_head(int fd, char *loc_alert_system_type) { char answer[100], command[100]; @@ -2050,11 +2050,61 @@ /*********************************************************************** * Create Location Alert System ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int create_loc_alert_system(int fd, char *loc_alert_system_type) +{ + char answer[100], command[100]; + int system_index = 0; + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "CLA,%s", loc_alert_system_type); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + + if (strncmp(answer, "CLA,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + sscanf(answer, "CSY,%d", &system_index); + + return (system_index); +} + /*********************************************************************** * Delete Location Alert System ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int delete_loc_alert_system(int fd, int loc_alert_system_index) +{ + char answer[100], command[500]; + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "DLA,%i",loc_alert_system_index ); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "DLA,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + /*********************************************************************** * Get Location Alert System Info ***********************************************************************/ @@ -2094,7 +2144,35 @@ /*********************************************************************** * Set Location Alert System Info ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_loc_alert_system_info(int fd, int loc_alert_system_index, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "LIN,%i,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", + loc_alert_system_index, parsed_line[1], parsed_line[2], parsed_line[3], + parsed_line[4], parsed_line[5], parsed_line[8], parsed_line[9], + parsed_line[10], parsed_line[11], parsed_line[12], + parsed_line[13]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "LIN,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Search/Close Call Settings ***********************************************************************/ @@ -2127,13 +2205,36 @@ } /*********************************************************************** -* Get Search/Close Call Settings -***********************************************************************/ - -/*********************************************************************** * Set Search/Close Call Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_srch_cc_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "SCO,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", + parsed_line[1], parsed_line[2], parsed_line[3], + parsed_line[4], parsed_line[5], parsed_line[6], parsed_line[7], + parsed_line[8], parsed_line[9], parsed_line[10], parsed_line[11], parsed_line[12]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "SCO,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Broadcast Screen Band Settings ***********************************************************************/ @@ -2172,7 +2273,31 @@ /*********************************************************************** * Set Broadcast Screen Band Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_bcast_screen_band_settings(int fd, int bcast_screen_band_settings_index, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "BBS,%i,%s,%s", bcast_screen_band_settings_index, + parsed_line[1], parsed_line[2]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "BBS,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Search Key Settings ***********************************************************************/ @@ -2207,7 +2332,31 @@ /*********************************************************************** * Set Search Key Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_search_key_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "SHK,%s,%s,%s,%s,%s,%s", parsed_line[1], + parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], parsed_line[6]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "SHK,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Global Lockout Frequency ***********************************************************************/ @@ -2253,11 +2402,57 @@ /*********************************************************************** * Unlock Global Lockout ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int unlock_global_lockout_freq(int fd, double global_lockout_freq) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "ULF,%f", global_lockout_freq); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "ULF,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Lockout Frequency ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int lockout_freq(int fd, double lockout_freq) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "LOF,%f", lockout_freq); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "LOF,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Close Call Settings ***********************************************************************/ @@ -2292,7 +2487,32 @@ /*********************************************************************** * Set Close Call Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_close_call_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "CLC,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", parsed_line[1], + parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], parsed_line[6], + parsed_line[7], parsed_line[8], parsed_line[9], parsed_line[10]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "CLC,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Service Search Settings ***********************************************************************/ @@ -2335,7 +2555,32 @@ /*********************************************************************** * Set Service Search Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_service_search_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "SSP,%s,%s,%s,%s,%s,%s,%s,%s", parsed_line[1], + parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], parsed_line[6], + parsed_line[7], parsed_line[8]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "SSP,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Custom Search Group ***********************************************************************/ @@ -2370,7 +2615,30 @@ /*********************************************************************** * Set Custom Search Group ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_custom_search_group(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "CSG,%s", parsed_line[1]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "CSG,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Custom Search Settings ***********************************************************************/ @@ -2411,7 +2679,34 @@ /*********************************************************************** * Set Custom Search Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_custom_search_settings(int fd, int search_index, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "CSP,%i, %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", search_index, + parsed_line[1], parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], + parsed_line[6], parsed_line[7], parsed_line[8], parsed_line[9], parsed_line[10], + parsed_line[11], parsed_line[12], parsed_line[13], parsed_line[14], parsed_line[15], + parsed_line[16]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "CSP,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Weather Settings ***********************************************************************/ @@ -2446,7 +2741,31 @@ /*********************************************************************** * Set Weather Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_weather_setting(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "WXS,%s,%s,%s,%s", parsed_line[1], parsed_line[2], + parsed_line[3], parsed_line[4]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "WXS,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Same Group Settings ***********************************************************************/ @@ -2484,7 +2803,32 @@ /*********************************************************************** * Set Same Group Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_same_group_settings(int fd, int same_index, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "SGP,%i, %s,%s,%s,%s,%s,%s,%s,%s,%s", same_index, + parsed_line[1], parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], + parsed_line[6], parsed_line[7], parsed_line[8], parsed_line[9]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "SGP,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Tone-Out Settings ***********************************************************************/ @@ -2523,7 +2867,33 @@ /*********************************************************************** * Set Tone-Out Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_tone_out_settings(int fd, int tone_out_index, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "TON,%i, %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", tone_out_index, + parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], + parsed_line[6], parsed_line[7], parsed_line[8], parsed_line[9], parsed_line[10], + parsed_line[11], parsed_line[12], parsed_line[13], parsed_line[14]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "TON,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get LCD Contrast Settings ***********************************************************************/ @@ -2558,7 +2928,30 @@ /*********************************************************************** * Set LCD Contrast Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_lcd_contrast_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "CNT,%s", parsed_line[1]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "CNT,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get LCD Upside Down Settings ***********************************************************************/ @@ -2593,7 +2986,30 @@ /*********************************************************************** * Set LCD Upside Down Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_lcd_upside_down_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "DUD,%s", parsed_line[1]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "DUD,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Scanner Option Settings ***********************************************************************/ @@ -2628,23 +3044,152 @@ /*********************************************************************** * Set Scanner Option Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_scanner_option_settings(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "SCN,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", + parsed_line[1], parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5], + parsed_line[6], parsed_line[7], parsed_line[8], parsed_line[9], parsed_line[10], + parsed_line[11], parsed_line[12], parsed_line[13], parsed_line[14], parsed_line[15], + parsed_line[16], parsed_line[17], parsed_line[18], parsed_line[19], parsed_line[20]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "SCN,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Volume Level Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int get_volume_level_settings(int fd) +{ + char answer[500], command[100]; + char *field[100]; + int i; + memset(answer, 0, 500); + memset(command, 0, 100); + memset(field, 0, 100); + + snprintf(command, 100, "VOL"); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + /* We have 2 parsed fields to print for this command */ + for (i = 0; i <= 1; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); + + return (0); +} + /*********************************************************************** * Set Volume Level Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_volume_level_settings(int fd, int volume_level) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "VOL,%i", volume_level); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "VOL,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get Squelch Level Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int get_squelch_level_settings(int fd) +{ + char answer[500], command[100]; + char *field[100]; + int i; + memset(answer, 0, 500); + memset(command, 0, 100); + memset(field, 0, 100); + + snprintf(command, 100, "SQL"); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + /* We have 2 parsed fields to print for this command */ + for (i = 0; i <= 1; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); + + return (0); +} + /*********************************************************************** * Set Squelch Level Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_squelch_level_settings(int fd, int squelch_level) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "SQL,%i", squelch_level); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "SQL,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get APCO Data Settings ***********************************************************************/ @@ -2679,11 +3224,39 @@ /*********************************************************************** * Set APCO Data Settings ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_apco_settings(int fd, int threshold) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "P25,%i", threshold); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + /* Uniden's documentation states: + "OK" returned when [APCO] is not DFLT + "NG" returned when [APCO] is DFLT + So, is "int threshold" == [APCO]??? I'll just check for "OK".*/ + if (strncmp(answer, "P25,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get GPS Display Option -* TODO: I don't have a GPS. Needs implementing & testing. +* TODO: I don't have a GPS. ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ int get_gps_display_option(int fd) { char answer[500], command[100]; @@ -2714,13 +3287,38 @@ /*********************************************************************** * Set GPS Display Option -* TODO: I don't have a GPS. Needs implementing & testing. +* TODO: I don't have a GPS. ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int set_gps_display_option(int fd, char **parsed_line) +{ + char answer[100], command[500]; + memset(answer, 0, 500); + memset(command, 0, 100); + + snprintf(command, 500, "GDO,%s,%s,%s,%s,%s", parsed_line[1], + parsed_line[2], parsed_line[3], parsed_line[4], parsed_line[5]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "GDO,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return (0); +} + /*********************************************************************** * Get GGA Data from GPS -* TODO: I don't have a GPS. Needs implementing & testing. +* TODO: I don't have a GPS. ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ int get_gps_gga_data(int fd) { char answer[100], command[100]; @@ -2751,8 +3349,9 @@ /*********************************************************************** * Get RMC Data from GPS -* TODO: I don't have a GPS. Needs implementing & testing. +* TODO: I don't have a GPS. ***********************************************************************/ +/* TODO: This needs to be implemented & tested */ int get_gps_rmc_data(int fd) { char answer[100], command[100]; @@ -2814,7 +3413,6 @@ /*********************************************************************** * Download BCD memory contents -* TODO: All done except misc stuff (see commands.h for commented code) * TODO: Need to also make things look nice. ***********************************************************************/ int dump(int fd, FILE * outfile) Modified: src/commands.h =================================================================== --- src/commands.h 2007-11-11 21:28:54 UTC (rev 141) +++ src/commands.h 2007-11-12 22:07:47 UTC (rev 142) @@ -38,40 +38,43 @@ /*********************************************************************** * Function Declarations - * TODO: Finish implementing commented-out functions below * TODO: Future frontend work might need return of entire parsed_fields * instead of just printing (ie. to stdout/file) and returning * nothing. Hence, these also might become installed libraries. ***********************************************************************/ + +/* Remote Control (Status Display) */ void get_current_tgid_status(int fd); int push_key(int fd, char key_code, char key_mode); int quick_search_hold_mode(int fd, char **parsed_line); void get_current_status(int fd); void get_reception_status(int fd); + +/* System Information */ void get_model_info(int fd); void get_firmware_version(int fd); +/* Program Control Mode */ int enter_prg_mode(int fd); int exit_prg_mode(int fd); +/* System Settings (Available in Program Mode Only) */ int get_backlight(int fd); int set_backlight(int fd, char **parsed_line); - int clear_memory(int fd); - int get_key_beep(int fd); int set_key_beep(int fd, char **parsed_line); - int get_opening_message(int fd); int set_opening_message(int fd, char **parsed_line); - int get_priority_mode(int fd); int set_priority_mode(int fd, char **parsed_line); int get_auto_gain_control(int fd); int set_auto_gain_control(int fd, char **parsed_line); +int get_system_count(int fd); - -/* Scan Settings - Goes in order we get/set - Calls Group Index only once instead of twice */ +/* Scan Settings (Available in Program Mode Only) + Goes in order we get/set except for call to + "Group Index" is only called once instead of twice. */ int get_system_count(int fd); int get_system_index_head(int fd); int get_system_index_tail(int fd); @@ -108,7 +111,6 @@ int set_apco25_band_plan(int fd, int site_index, char **parsed_line); int get_trunk_freq_info(int fd, int channel_index); int set_trunk_freq_info(int fd, int channel_index, char **parsed_line); -/* End Scan Settings Commands */ int get_lockout_tgid(int fd, int system_index); @@ -119,58 +121,67 @@ int forward_index(int fd, int index); int get_remains_memory_block(int fd); int get_memory_used(int fd); + +/* Location Settings (Available in Program Mode Only) */ int loc_alert_system_index_head(int fd, char *loc_alert_system_type); int get_loc_alert_system_index_tail(int fd, char *loc_alert_system_type); -/*int create_loc_alert_system(int fd, char *loc_alert_system_type); -int delete_loc_alert_system(int loc_alert_system_index);*/ +int create_loc_alert_system(int fd, char *loc_alert_system_type); +int delete_loc_alert_system(int fd, int loc_alert_system_index); int get_loc_alert_system_info(int fd, int loc_alert_system_index); -/*int set_loc_alert_system_info(int fd, int loc_alert_system_index, char **parsed_line);*/ +int set_loc_alert_system_info(int fd, int loc_alert_system_index, char **parsed_line); + +/* Search/Close Call Settings (Available in Program Mode Only) */ int get_srch_cc_settings(int fd); -/*int set_srch_cc_settings(int fd, char **parsed_line);*/ +int set_srch_cc_settings(int fd, char **parsed_line); int get_bcast_screen_band_settings(int fd); -/*int set_bcast_screen_band_settings(int fd, int bcast_screen_band_settings_index, char **parsed_line);*/ +int set_bcast_screen_band_settings(int fd, int bcast_screen_band_settings_index, char **parsed_line); int get_search_key_settings(int fd); -/*int set_search_key_settings(int fd, char **parsed_line); */ +int set_search_key_settings(int fd, char **parsed_line); int get_global_lockout_freq(int fd); -/* int unlock_global_lockout_freq(int fd, double global_lockout_freq); -int lock_out_freq(int fd, double frequency);*/ +int unlock_global_lockout_freq(int fd, double global_lockout_freq); +int lockout_freq(int fd, double lockout_freq); int get_close_call_settings(int fd); -/*int set_close_call_settings(int fd, char **parsed_line);*/ +int set_close_call_settings(int fd, char **parsed_line); + +/* Misc (Available in Program Mode Only) */ int get_service_search_settings(int fd); -/*int set_service_search_settings(int fd, int search_index, char **parsed_line);*/ +int set_service_search_settings(int fd, char **parsed_line); int get_custom_search_group(int fd); -/*int set_custom_search_group(int fd, char **parsed_line);*/ +int set_custom_search_group(int fd, char **parsed_line); int get_custom_search_settings(int fd); -/*int set_custom_search_settings(int fd, int search_index, char **parsed_line);*/ +int set_custom_search_settings(int fd, int search_index, char **parsed_line); int get_weather_settings(int fd); -/*int set_weather_setting(int fd, char **parsed_line);*/ +int set_weather_setting(int fd, char **parsed_line); int get_same_group_settings(int fd); -/*int set_same_group_settings(int fd, int same_index, char **parsed_line);*/ +int set_same_group_settings(int fd, int same_index, char **parsed_line); int get_tone_out_settings(int fd); -/*int set_tone_out_settings(int fd, int tone_out_index, char **parsed_line);*/ +int set_tone_out_settings(int fd, int tone_out_index, char **parsed_line); int get_lcd_contrast_settings(int fd); -/*int set_lcd_contrast_settings(int fd, char **parsed_line);*/ +int set_lcd_contrast_settings(int fd, char **parsed_line); int get_lcd_upside_down_settings(int fd); -/*int set_lcd_upside_down_settings(int fd, char **parsed_line);*/ +int set_lcd_upside_down_settings(int fd, char **parsed_line); int get_scanner_option_settings(int fd); -/*int set_scanner_option_settings(int fd, char **parsed_line); +int set_scanner_option_settings(int fd, char **parsed_line); + +/* Misc (Use not restricted to Program Mode) */ int get_volume_level_settings(int fd); int set_volume_level_settings(int fd, int volume_level); int get_squelch_level_settings(int fd); -int set_squelch_level_settings(int fd, int squelch_level);*/ +int set_squelch_level_settings(int fd, int squelch_level); int get_apco_settings(int fd); -/*int set_apco_settings(int fd, char **parsed_line);*/ +int set_apco_settings(int fd, int threshold); +/* GPS Related (Available in Program Mode Only) */ +/* (Not Tested. I don't have a GPS for this scanner) */ +int get_gps_display_option(int fd); +int set_gps_display_option(int fd, char **parsed_line); -/* GPS Related -- I don't have a GPS for this scanner */ -int get_gps_display_option(int fd); -/*int set_gps_display_option(int fd, char **parsed_line);*/ -int get_gps_gga_data(int fd); /* TODO: Untested! */ -int get_gps_rmc_data(int fd); /* TODO: Untested! */ +/* GPS Related (Use not restricted to Program Mode) */ +int get_gps_gga_data(int fd); +int get_gps_rmc_data(int fd); int get_window_voltage(int fd); - -/* Undocumented Uniden Firmware Mode Commands */ +/* Undocumented Uniden Firmware Mode Commands (Available in Program Mode Only) */ int fw_mode_model_info(int fd, char *fwm_model); int fw_mode_set_speed(int fd, char *fwm_speed); int fw_mode_pgl(int fd, int pgl_value); @@ -178,8 +189,7 @@ int fw_mode_scb(int fd, int scb_value); int fw_mode_program(int fd); - -/* Higher Level Functions using above lower level scanner commands */ +/* Higher-level Functions using above Lower-level Scanner Commands */ int dump(int fd, FILE *outfile); int load_firmware(int fd, FILE *infile); int load(int fd, FILE *infile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-11-11 21:28:56
|
Revision: 141 http://dsctl.svn.sourceforge.net/dsctl/?rev=141&view=rev Author: roger-linux Date: 2007-11-11 13:28:54 -0800 (Sun, 11 Nov 2007) Log Message: ----------- src/commands.c - Added: New commands/functions. (Not implemented into dump/load yet.) Fixed: BKL not getting all of it's data. Added: Stubs/comments for future commands/functions. src/utils.h - Trivial: Added comments to my functions for easier reading. src/commands.h - Trivial: Uncommented the function names I added today. (Corrected a few of the newly uncommented functions.) src/human_commands.c - Trivial: Adjusted comment styles. Modified Paths: -------------- src/commands.c src/commands.h src/human_commands.c src/utils.h Modified: src/commands.c =================================================================== --- src/commands.c 2007-11-10 21:40:39 UTC (rev 140) +++ src/commands.c 2007-11-11 21:28:54 UTC (rev 141) @@ -356,8 +356,8 @@ /*printf("%s\n(%i)\n", answer, strlen(answer)); */ parse_fields(answer, field); - /* We have 2 parsed fields to print for this command */ - for (i = 0; i <= 1; i++) + /* We have 3 parsed fields to print for this command */ + for (i = 0; i <= 2; i++) { if (i != 0) printf(","); @@ -371,10 +371,30 @@ /*********************************************************************** * Set Backlight ***********************************************************************/ -/*int set_backlight(int fd, char **parsed_line) +/* TODO: This needs to be implemented into load() & tested */ +int set_backlight(int fd, char **parsed_line) { + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "BKL,%s,%s", parsed_line[1], parsed_line[2]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "BKL,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + return(0); -}*/ +} /*********************************************************************** * Get Key Beep @@ -408,6 +428,34 @@ } /*********************************************************************** +* Set Key Beep +***********************************************************************/ +/* TODO: This needs to be implemented into load() & tested */ +int set_key_beep(int fd, char **parsed_line) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "KBP,%s", parsed_line[1]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "KBP,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get Opening Message ***********************************************************************/ int get_opening_message(int fd) @@ -440,6 +488,35 @@ } /*********************************************************************** +* Set Opening Message +***********************************************************************/ +/* TODO: This needs to be implemented into load() & tested */ +int set_opening_message(int fd, char **parsed_line) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "OMS,%s,%s,%s,%s", parsed_line[1], parsed_line[2], + parsed_line[3], parsed_line[4]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "OMS,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get Priority Mode ***********************************************************************/ int get_priority_mode(int fd) @@ -471,6 +548,34 @@ } /*********************************************************************** +* Set Priority Mode +***********************************************************************/ +/* TODO: This needs to be implemented into load() & tested */ +int set_priority_mode(int fd, char **parsed_line) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "PRI,%s", parsed_line[1]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "PRI,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get Auto Gain Control ***********************************************************************/ int get_auto_gain_control(int fd) @@ -502,6 +607,34 @@ } /*********************************************************************** +* Set Auto Gain Control +***********************************************************************/ +/* TODO: This needs to be implemented into load() & tested */ +int set_auto_gain_control(int fd, char **parsed_line) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "AGV,%s,%s", parsed_line[1], parsed_line[2]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "AGV,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get System Count ***********************************************************************/ int get_system_count(int fd) @@ -630,6 +763,37 @@ } /*********************************************************************** +* Set System/Site Quick Lockout +***********************************************************************/ +/* TODO: This needs to be implemented into load() & tested */ +int set_system_quick_lockout(int fd, char **parsed_line) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "QSL,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", parsed_line[1], + parsed_line[2], parsed_line[3], parsed_line[4], + parsed_line[5], parsed_line[6], parsed_line[7], + parsed_line[8], parsed_line[9], parsed_line[10]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "QSL,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get Group Quick Lockout ***********************************************************************/ int get_group_quick_lockout(int fd, int system_index) @@ -661,6 +825,34 @@ } /*********************************************************************** +* Set Group Quick Lockout +***********************************************************************/ +/* TODO: This needs to be implemented into load() & tested */ +int set_group_quick_lockout(int fd, int system_index, char **parsed_line) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "QGL,%i,%s", system_index, parsed_line[1]); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "QGL,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Clear All Memory ***********************************************************************/ int clear_memory(int fd) @@ -715,6 +907,34 @@ } /*********************************************************************** +* Delete System +***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int delete_system(int fd, int system_index) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "DSY,%i", system_index); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "DSY,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get System ***********************************************************************/ int get_system_info(int fd, int system_index, char *system_type, @@ -926,6 +1146,34 @@ } /*********************************************************************** +* Delete Group/Site +***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int delete_site_or_group(int fd, int site_or_group_index) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "DGR,%i", site_or_group_index); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "DGR,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get Group Information ***********************************************************************/ int get_group_info(int fd, int group_index, char *channel_index) @@ -1051,6 +1299,34 @@ } /*********************************************************************** +* Delete Channel +***********************************************************************/ +/* TODO: This needs to be implemented & tested */ +int delete_channel(int fd, int channel_index) +{ + char answer[100], command[500]; + + memset(answer, 0, 100); + memset(command, 0, 500); + + snprintf(command, 500, + "DCH,%i", channel_index); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "DCH,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + +/*********************************************************************** * Get Channel Information ***********************************************************************/ int get_channel_info(int fd, int channel_index) @@ -1463,7 +1739,7 @@ /*********************************************************************** * Get Locked Out TGIDs ***********************************************************************/ -/* TODO - Ensure GLI info is downloading. It seems to work. */ +/* TODO - Check GLI info is downloading. It seems to work. */ int get_lockout_tgid(int fd, int system_index) { char answer[100], command[100]; @@ -1506,7 +1782,7 @@ /*********************************************************************** * Get Search Lockout TGID ***********************************************************************/ -/* TODO - Ensure SLI info is downloading. It seems to work. */ +/* TODO - Check SLI info is downloading. It seems to work. */ int get_search_lockout_tgid(int fd, int system_index) { char answer[100], command[100]; @@ -1547,22 +1823,124 @@ } /*********************************************************************** -* Unlock TGID - TODO +* Unlock TGID ***********************************************************************/ -/*int unlock_tgid(int fd, int system_index) +/* TODO: This needs to be implemented & tested */ +int unlock_tgid(int fd, int system_index, int tgid) { + char answer[100], command[500]; -} */ + memset(answer, 0, 100); + memset(command, 0, 500); + snprintf(command, 500, + "ULI,%i,%i", system_index, tgid); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "ULI,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + /*********************************************************************** -* Lockout TGID - TODO +* Lockout TGID ***********************************************************************/ -/* int lockout_tgid(int fd, int system_index) +/* TODO: This needs to be implemented & tested */ +int lockout_tgid(int fd, int system_index, int tgid) { + char answer[100], command[500]; -} */ + memset(answer, 0, 100); + memset(command, 0, 500); + snprintf(command, 500, + "LOI,%i,%i", system_index, tgid); + printf("\nCommand == %s\n", command); + do_command(fd, command, answer); + printf("%s\n(%i)\n", answer, strlen(answer)); + + check_err(command, answer); + + if (strncmp(answer, "LOI,OK", 6) != 0) + { + exit_prg_mode(fd); + u_err(command, answer); + } + + return(0); +} + /*********************************************************************** +* Get Reverse Index +***********************************************************************/ +/* TODO: Unused. This needs to be implemented & tested if needed. */ +int reverse_index(int fd, int index) +{ + char answer[100], command[100]; + char *field[100]; + int i; + + memset(answer, 0, 100); + memset(command, 0, 100); + memset(field, 0, 100); + snprintf(command, 100, "REV,%i", index); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + /* We have 2 parsed fields to print for this command */ + for (i = 0; i <= 1; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); + + return (0); +} + +/*********************************************************************** +* Get Forward Index +***********************************************************************/ +/* TODO: Unused. This needs to be implemented & tested if needed. */ +int forward_index(int fd, int index) +{ + char answer[100], command[100]; + char *field[100]; + int i; + + memset(answer, 0, 100); + memset(command, 0, 100); + memset(field, 0, 100); + snprintf(command, 100, "FWD,%i", index); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + /* We have 2 parsed fields to print for this command */ + for (i = 0; i <= 1; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); + + return (0); +} + +/*********************************************************************** * Get Remains of Memory ***********************************************************************/ int get_remains_memory_block(int fd) @@ -1626,6 +2004,7 @@ /*********************************************************************** * Get Location Alert System Index Head ***********************************************************************/ +/* TODO: This needs to be tested/checked. */ int loc_alert_system_index_head(int fd, char *loc_alert_system_type) { char answer[100], command[100]; @@ -1646,8 +2025,39 @@ } /*********************************************************************** -* Get Location Alert System System Info +* Get Location Alert System Index Tail ***********************************************************************/ +/* TODO: Unused. This needs to be implemented & tested if needed. */ +int get_loc_alert_system_index_tail(int fd, char *loc_alert_system_type) +{ + char answer[100], command[100]; + char *field[100]; + int loc_indextail = 0; + + memset(answer, 0, 100); + memset(command, 0, 100); + memset(field, 0, 100); + + snprintf(command, 100, "LIT,%s", loc_alert_system_type); + /*printf("Command == %s\n", command); */ + do_command(fd, command, answer); + /*printf("\n%s\n(%i)\n", answer, strlen(answer)); */ + sscanf(answer, "LIT,%i", &loc_indextail); + + return (loc_indextail); +} + +/*********************************************************************** +* Create Location Alert System +***********************************************************************/ + +/*********************************************************************** +* Delete Location Alert System +***********************************************************************/ + +/*********************************************************************** +* Get Location Alert System Info +***********************************************************************/ int get_loc_alert_system_info(int fd, int loc_alert_system_index) { char answer[500], command[100]; @@ -1682,6 +2092,10 @@ } /*********************************************************************** +* Set Location Alert System Info +***********************************************************************/ + +/*********************************************************************** * Get Search/Close Call Settings ***********************************************************************/ int get_srch_cc_settings(int fd) @@ -1713,6 +2127,14 @@ } /*********************************************************************** +* Get Search/Close Call Settings +***********************************************************************/ + +/*********************************************************************** +* Set Search/Close Call Settings +***********************************************************************/ + +/*********************************************************************** * Get Broadcast Screen Band Settings ***********************************************************************/ int get_bcast_screen_band_settings(int fd) @@ -1748,6 +2170,10 @@ } /*********************************************************************** +* Set Broadcast Screen Band Settings +***********************************************************************/ + +/*********************************************************************** * Get Search Key Settings ***********************************************************************/ int get_search_key_settings(int fd) @@ -1779,6 +2205,10 @@ } /*********************************************************************** +* Set Search Key Settings +***********************************************************************/ + +/*********************************************************************** * Get Global Lockout Frequency ***********************************************************************/ int get_global_lockout_freq(int fd) @@ -1821,6 +2251,14 @@ } /*********************************************************************** +* Unlock Global Lockout +***********************************************************************/ + +/*********************************************************************** +* Lockout Frequency +***********************************************************************/ + +/*********************************************************************** * Get Close Call Settings ***********************************************************************/ int get_close_call_settings(int fd) @@ -1852,6 +2290,10 @@ } /*********************************************************************** +* Set Close Call Settings +***********************************************************************/ + +/*********************************************************************** * Get Service Search Settings ***********************************************************************/ int get_service_search_settings(int fd) @@ -1891,6 +2333,10 @@ } /*********************************************************************** +* Set Service Search Settings +***********************************************************************/ + +/*********************************************************************** * Get Custom Search Group ***********************************************************************/ int get_custom_search_group(int fd) @@ -1922,6 +2368,10 @@ } /*********************************************************************** +* Set Custom Search Group +***********************************************************************/ + +/*********************************************************************** * Get Custom Search Settings ***********************************************************************/ int get_custom_search_settings(int fd) @@ -1959,6 +2409,10 @@ } /*********************************************************************** +* Set Custom Search Settings +***********************************************************************/ + +/*********************************************************************** * Get Weather Settings ***********************************************************************/ int get_weather_settings(int fd) @@ -1990,6 +2444,10 @@ } /*********************************************************************** +* Set Weather Settings +***********************************************************************/ + +/*********************************************************************** * Get Same Group Settings ***********************************************************************/ int get_same_group_settings(int fd) @@ -2024,6 +2482,10 @@ } /*********************************************************************** +* Set Same Group Settings +***********************************************************************/ + +/*********************************************************************** * Get Tone-Out Settings ***********************************************************************/ int get_tone_out_settings(int fd) @@ -2059,6 +2521,10 @@ } /*********************************************************************** +* Set Tone-Out Settings +***********************************************************************/ + +/*********************************************************************** * Get LCD Contrast Settings ***********************************************************************/ int get_lcd_contrast_settings(int fd) @@ -2090,6 +2556,10 @@ } /*********************************************************************** +* Set LCD Contrast Settings +***********************************************************************/ + +/*********************************************************************** * Get LCD Upside Down Settings ***********************************************************************/ int get_lcd_upside_down_settings(int fd) @@ -2121,6 +2591,10 @@ } /*********************************************************************** +* Set LCD Upside Down Settings +***********************************************************************/ + +/*********************************************************************** * Get Scanner Option Settings ***********************************************************************/ int get_scanner_option_settings(int fd) @@ -2152,6 +2626,26 @@ } /*********************************************************************** +* Set Scanner Option Settings +***********************************************************************/ + +/*********************************************************************** +* Get Volume Level Settings +***********************************************************************/ + +/*********************************************************************** +* Set Volume Level Settings +***********************************************************************/ + +/*********************************************************************** +* Get Squelch Level Settings +***********************************************************************/ + +/*********************************************************************** +* Set Squelch Level Settings +***********************************************************************/ + +/*********************************************************************** * Get APCO Data Settings ***********************************************************************/ int get_apco_settings(int fd) @@ -2183,7 +2677,12 @@ } /*********************************************************************** +* Set APCO Data Settings +***********************************************************************/ + +/*********************************************************************** * Get GPS Display Option +* TODO: I don't have a GPS. Needs implementing & testing. ***********************************************************************/ int get_gps_display_option(int fd) { @@ -2214,7 +2713,13 @@ } /*********************************************************************** +* Set GPS Display Option +* TODO: I don't have a GPS. Needs implementing & testing. +***********************************************************************/ + +/*********************************************************************** * Get GGA Data from GPS +* TODO: I don't have a GPS. Needs implementing & testing. ***********************************************************************/ int get_gps_gga_data(int fd) { @@ -2246,6 +2751,7 @@ /*********************************************************************** * Get RMC Data from GPS +* TODO: I don't have a GPS. Needs implementing & testing. ***********************************************************************/ int get_gps_rmc_data(int fd) { Modified: src/commands.h =================================================================== --- src/commands.h 2007-11-10 21:40:39 UTC (rev 140) +++ src/commands.h 2007-11-11 21:28:54 UTC (rev 141) @@ -38,9 +38,11 @@ /*********************************************************************** * Function Declarations + * TODO: Finish implementing commented-out functions below + * TODO: Future frontend work might need return of entire parsed_fields + * instead of just printing (ie. to stdout/file) and returning + * nothing. Hence, these also might become installed libraries. ***********************************************************************/ -/* TODO: Finish implementing commented-out functions below */ - void get_current_tgid_status(int fd); int push_key(int fd, char key_code, char key_mode); int quick_search_hold_mode(int fd, char **parsed_line); @@ -53,20 +55,20 @@ int exit_prg_mode(int fd); int get_backlight(int fd); -/*int set_backlight(int fd, char **parsed_line);*/ +int set_backlight(int fd, char **parsed_line); int clear_memory(int fd); int get_key_beep(int fd); -/*int set_key_beep(int fd, char **parsed_line);*/ +int set_key_beep(int fd, char **parsed_line); int get_opening_message(int fd); -/*int set_opening_message(int fd, char **parsed_line);*/ +int set_opening_message(int fd, char **parsed_line); int get_priority_mode(int fd); -/*int set_priority_mode(int fd, char **parsed_line);*/ +int set_priority_mode(int fd, char **parsed_line); int get_auto_gain_control(int fd); -/*int set_auto_gain_control(int fd, char **parsed_line);*/ +int set_auto_gain_control(int fd, char **parsed_line); /* Scan Settings - Goes in order we get/set - Calls Group Index only once instead of twice */ @@ -74,11 +76,11 @@ int get_system_index_head(int fd); int get_system_index_tail(int fd); int get_system_quick_lockout(int fd); -/*int set_system_quick_lockout(int fd, char **parsed_line);*/ +int set_system_quick_lockout(int fd, char **parsed_line); int get_group_quick_lockout(int fd, int system_index); -/*int set_group_quick_lockout(int fd, char **parsed_line);*/ +int set_group_quick_lockout(int fd, int system_index, char **parsed_line); int create_system(int fd, char *system_type); -/*int delete_system(int fd);*/ +int delete_system(int fd, int system_index); int get_system_info(int fd, int system_index, char *system_type, char *channel_group_head); int set_system_info(int fd, int system_index, char **parsed_line); @@ -86,12 +88,12 @@ int set_trunk_info(int fd, int system_index, char **parsed_line); int append_channel_group(int fd, int system_index); int append_tgid_group(int fd, int system_index); -/*int delete_group(int fd, group_index); *//* Use same function for delete_site */ +int delete_site_or_group(int fd, int site_or_group_index); /* Use same function for both site & group */ int get_group_info(int fd, int group_index, char *channel_index); int set_group_info(int fd, int group_index, char **parsed_line); int append_channel_freq(int fd, int group_index); /* Use same function for append_trunk_freq */ int append_tgid(int fd, int group_index); -/*int delete_channel(int fd, channel_index);*/ +int delete_channel(int fd, int channel_index); int get_channel_info(int fd, int channel_index); int set_channel_info(int fd, int channel_index, char **parsed_line); int get_tgid_info(int fd, int tgid_index); @@ -111,18 +113,18 @@ int get_lockout_tgid(int fd, int system_index); int get_search_lockout_tgid(int fd, int system_index); -/*int unlock_tgid(int fd, int system_index); -int lockout_tgid(int fd, int system_index); +int unlock_tgid(int fd, int system_index, int tgid); +int lockout_tgid(int fd, int system_index, int tgid); int reverse_index(int fd, int index); -int forward_index(int fd, int index);*/ +int forward_index(int fd, int index); int get_remains_memory_block(int fd); int get_memory_used(int fd); int loc_alert_system_index_head(int fd, char *loc_alert_system_type); -/*int get_loc_alert_system_index_tail(int fd, char *loc_alert_system_type); -int create_loc_alert_system(int fd, char *loc_alert_system_type); +int get_loc_alert_system_index_tail(int fd, char *loc_alert_system_type); +/*int create_loc_alert_system(int fd, char *loc_alert_system_type); int delete_loc_alert_system(int loc_alert_system_index);*/ int get_loc_alert_system_info(int fd, int loc_alert_system_index); -/*int set_loc_alert_system_info(int fd, int loc_alert_system_index, char**parsed_line);*/ +/*int set_loc_alert_system_info(int fd, int loc_alert_system_index, char **parsed_line);*/ int get_srch_cc_settings(int fd); /*int set_srch_cc_settings(int fd, char **parsed_line);*/ int get_bcast_screen_band_settings(int fd); Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-11-10 21:40:39 UTC (rev 140) +++ src/human_commands.c 2007-11-11 21:28:54 UTC (rev 141) @@ -176,7 +176,7 @@ } /*********************************************************************** - * Load Command + * Load command ***********************************************************************/ void human_do_load(int fd, int argc, char **args) { @@ -291,7 +291,7 @@ } /*********************************************************************** - * get help + * Get help ***********************************************************************/ void human_help(int fd, int argc, char **args) { Modified: src/utils.h =================================================================== --- src/utils.h 2007-11-10 21:40:39 UTC (rev 140) +++ src/utils.h 2007-11-11 21:28:54 UTC (rev 141) @@ -111,10 +111,19 @@ int withinlimits(double freq); void print_s_meter(char *slchar); -//int do_parse(char *unparsed, char **parsed); +/* Deprecated parse a comma seperated string into an array */ +/*int do_parse(char *unparsed, char **parsed);*/ + +/* Parse a comma seperated answer string into an array called fields */ int parse_fields(char *unparsed, char **parsed); + +/* Replace non-printable characters returned from the status command */ int replace_chars(char *bcd_chars, char *common_chars); + +/* Write a metadata file for ogg123 or Icecast to display freq/tgid info */ void write_metadata(char *album_field, char *artist_field, char *title_field); + +/* Used for resetting $HOME variable for writing .dsctl files. */ int reset_env_var(char *env_var, char *remove); #endif /* _UTILS_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-11-10 21:40:42
|
Revision: 140 http://dsctl.svn.sourceforge.net/dsctl/?rev=140&view=rev Author: roger-linux Date: 2007-11-10 13:40:39 -0800 (Sat, 10 Nov 2007) Log Message: ----------- commands.h/commands.c - Added get_lockout_tgid, get_search_lockout_tgid commands.c - Trivial: Removed not needed variables within functions. Trivial: Improved readability of misc comments. Trivial: Added TODO file. Optimized: Reduced duplicate usage of atoi and made comments within code for aiding anybody else reading the code. Modified Paths: -------------- src/commands.c src/commands.h Added Paths: ----------- TODO Added: TODO =================================================================== --- TODO (rev 0) +++ TODO 2007-11-10 21:40:39 UTC (rev 140) @@ -0,0 +1,63 @@ +1) Implementing the commands according to the BCD996T_Protocol.pdf + is simply the only things left to do besides some bugs + concerning serial communication. Most of the protocol commands, + if not all of them, are located within the commands.c file. + + I've completed almost all the _get_ commands to retrieve data + from the units including some of the _set_ commands to send + data to the unit. To see what I haven't done yet, look at the + commands.h file for commented function declarations. Obviously, + these are the functions (aka scanner commands) needing + implementing. + + It's quite easy really. You can basically copy/paste over most + of the code within the previous functions according to whether + it's a get_ or set_ command. You just need to either read the + returned comma parsed string into the proper varaibles for + printing. If the command is to _set or send data, again, the + string needs to be read in from file and formated properly before + sending the string to the scanner. + + I've even found the commands for uploading firmware. + + The only gotcha, I tried implementing a delay into the serial.c + with hopes of the program detecting a stall and quiting instead + of locking the computer with the system call. You may notice the + delay values somewhere between 10 seconds to 45+ seconds for + downloading or uploading. For loading the firmware, it can take + more then 5 minutes. + + I, or somebody else, might consider re-writing the code once the + functions are implemented for easier reading. Should probably use + structs? + + If you look at the protocol pdf file, I'm also missing APPEND + functions. + + +2) Some sort of frontend is needed for programming this scanner. + There's just too much loose data, requiring specific ranges, etc, + for a simple user to enter by hand. I'm up for ideas here. + Gnome or ncurses based UI??? Well, I do have autoconfig/automake + installed, albeit, roughly. + + One method probably doesn't require much of a frontend, direct + downloading for radioreference.com. However, users generally + still have to fill in TGID's after searching for them on an + APCO based system. + +3) I do have a basic command implemented for Live Streaming via + Icecast. The stream is also updated with the active frequency data. + There's a bug, after a time period of streaming, the + ncurses display will freeze, but it basically works. (Think the + bug/freeze is encountered with certain freq/band is hit.) + +4) Future: + a) Possible rewrite using structs instead of all arrays and + pointers? + b) I'm seeing a lot of repeated code and could easily be + integrated into functions within utils.c. + + These items could significantly shorten code while increase + readability. + Modified: src/commands.c =================================================================== --- src/commands.c 2007-11-06 01:37:19 UTC (rev 139) +++ src/commands.c 2007-11-10 21:40:39 UTC (rev 140) @@ -35,10 +35,14 @@ void get_current_tgid_status(int fd) { /* GID - Current TGID Status - * Uniden's GID & GLG commands only prints out the first unique occurance - * of active TGID info. After the first display, repeated reissues of - * these commands will return null until a different TGID becomes active. - * Save last info and recall it as "Last GID/GID Active:"? */ + * Uniden's GID & GLG commands only prints out the first unique + * occurance of active TGID info. After the first display, repeated + * reissues of these commands will return null until a different TGID + * becomes active. + + * Save last info into temp file and recall it as needed? Think I've + * fixed this. See what data I'm putting into ~/.dsctl/metadata + * file. */ char answer[500]; char *field[100]; @@ -116,7 +120,9 @@ replace_chars(field[8], field[8]); /*printf("Test replace_chars: %s, %i\n\n\n", field[8], strlen(field[8]); */ - //replace_chars(field[10], field[10]); /* replace_chars is omitting Sytems Scan status line, so comment out for now */ + /*replace_chars(field[10], field[10]);*/ /* replace_chars is omitting + Sytems Scan status line, so comment out for now */ + /*printf("Test replace_chars: %s, %i\n\n\n", field[8], strlen(field[8]); */ /* Detect scroll effect of the 6th field SCAN and @@ -296,7 +302,8 @@ check_err(command, answer); - /* TODO: We only check for "OK" and not the "," when a 16 char name remains unchanged */ + /* TODO: We only check for "OK" and not the "," when a 16 char name + remains unchanged */ if (strncmp(answer, "PRG,OK", 6) != 0) { exit_prg_mode(fd); @@ -713,7 +720,6 @@ int get_system_info(int fd, int system_index, char *system_type, char *channel_group_head) { - //get_group_quick_lockout(fd, sys_index); /* This might break things */ char answer[500], command[100]; char *field[100]; @@ -741,16 +747,11 @@ /* Set our starting Group and Site index addresses from SIN info */ /* Pointers are returned from parse_fields, use strncpy for strings. */ - //siteinfo_index = atoi(sys_field[14]); - //trunkinfo_index = sys_index; - //grpinfo_index = atoi(sys_field[14]); - //strncpy(sys_type, sys_field[1], 5); strncpy(system_type, field[1], 5); strncpy(channel_group_head, field[14], 10); - /*sys_type = sys_field[1]; */ - /*printf("systype = %s\n", sys_type); */ - /*printf("trunkinfo_index = %i\n", trunkinfo_index); */ + /*printf("systype = %s\n", system_type); */ + /*printf("sys_index = %i\n", sys_index); */ /* We're using the Forward System Index field for getting the * next System Info address. Set this after we set the above variables. */ @@ -821,16 +822,12 @@ } printf("\n"); - /* We're using the Forward Site Info Index field for - * getting the next Site Info address. - * There is no forward index for this group. Uses sys_field[14]. */ - /*trunkinfo_index = atoi (trunkinfoinfo_field[12]); */ - - /* Reset starting GIN address since we're a Trunked System - * instead of using the SIN address values for starting GIN - * - * We have no map of the internal memory. Linking starting TRN/GIN/TIN addresses - * is guess work because of the poorly proof-read Uniden documentation. */ + /* Since we're a Trunked System, provide an alternative starting + * GIN index instead of using the provided SIN address for starting + * GIN index value. (Flip Flop here for getting the GIN index + * address :-/ Finding starting addresses for TRN/GIN/TIN commands + * is guess work because of the poorly proof-read documentation. + :-/ ) */ group_info_index = atoi(field[21]); return (group_info_index); @@ -1464,6 +1461,108 @@ } /*********************************************************************** +* Get Locked Out TGIDs +***********************************************************************/ +/* TODO - Ensure GLI info is downloading. It seems to work. */ +int get_lockout_tgid(int fd, int system_index) +{ + char answer[100], command[100]; + char *field[100]; + int i, cmd_index = 0; + + memset(answer, 0, 100); + memset(command, 0, 100); + memset(field, 0, 100); + + snprintf(command, 100, "GLI,%i", system_index); + /* printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /* printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + cmd_index = atoi(field[1]); + + /* While we have L/O TGIDs, get them. */ + while (cmd_index != -1) + { + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + /* We have 2 parsed fields to print for this command */ + for (i = 0; i <= 1; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); + cmd_index = atoi(field[1]); + } + + return (0); +} + +/*********************************************************************** +* Get Search Lockout TGID +***********************************************************************/ +/* TODO - Ensure SLI info is downloading. It seems to work. */ +int get_search_lockout_tgid(int fd, int system_index) +{ + char answer[100], command[100]; + char *field[100]; + int i, cmd_index = 0; + + memset(answer, 0, 100); + memset(command, 0, 100); + memset(field, 0, 100); + + snprintf(command, 100, "SLI,%i", system_index); + /* printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /* printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + cmd_index = atoi(field[1]); + + /* While we have Search L/O TGIDs, get them. */ + while (cmd_index != -1) + { + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + parse_fields(answer, field); + + /* We have 2 parsed fields to print for this command */ + for (i = 0; i <= 1; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); + cmd_index = atoi(field[1]); + } + + return (0); +} + +/*********************************************************************** +* Unlock TGID - TODO +***********************************************************************/ +/*int unlock_tgid(int fd, int system_index) +{ + +} */ + +/*********************************************************************** +* Lockout TGID - TODO +***********************************************************************/ +/* int lockout_tgid(int fd, int system_index) +{ + +} */ + +/*********************************************************************** * Get Remains of Memory ***********************************************************************/ int get_remains_memory_block(int fd) @@ -1543,10 +1642,6 @@ /*printf("\n%s\n(%i)\n", answer, strlen(answer)); */ sscanf(answer, "LIH,%i", &loc_indexhead); - /* While we have Location Alert Systems, then print them. - * And once we find the first system, find the next one using - * forward system index field */ - return (loc_indexhead); } @@ -2213,7 +2308,8 @@ /*********************************************************************** * Download BCD memory contents -* TODO: All done. Just need to make things look nice. +* TODO: All done except misc stuff (see commands.h for commented code) +* TODO: Need to also make things look nice. ***********************************************************************/ int dump(int fd, FILE * outfile) { @@ -2221,9 +2317,8 @@ char sys_type[5], site_type[5]; - int sys_index, grpinfo_index, chaninfo_index, trunkinfo_index, - siteinfo_index, motbandplan_index, apcobandplan_index, - trunkfreq_index, tgidinfo_index; + int sys_index, grpinfo_index, chaninfo_index, + siteinfo_index, trunkfreq_index, tgidinfo_index; /* File Version Format */ printf("dsctl version %s\n\n", FFVERSION); @@ -2290,7 +2385,13 @@ get_gps_display_option(fd); - /* Get Scan Settings */ + /* Get Scan Settings + * The "scan data" is organized into two basic trees. One for + * conventional freqs and the other tree organized for trunked freqs. + * I ordered the function calls below into a very particular order + * intended to reduce overhead on the scanner. (ie. We've already + * gotten the data once. Why make a second call to the scanner when we + * already have the data?) */ /* SIN * While we have System Indexes, then print them. @@ -2311,30 +2412,20 @@ /* Continue getting System Info */ char channel_group_head[10]; - int next_system_index = 0; + int next_sys_index = 0; memset(channel_group_head, 0, 10); - next_system_index = + next_sys_index = get_system_info(fd, sys_index, sys_type, channel_group_head); - /* Set our starting Group and Site index addresses from SIN info */ - //siteinfo_index = atoi(sys_field[14]);*/ + /* Set our starting Group and Site index addresses from SIN info - Reduced atoi usage*/ siteinfo_index = atoi(channel_group_head); - trunkinfo_index = sys_index; - //grpinfo_index = atoi(sys_field[14]); - grpinfo_index = atoi(channel_group_head); - //strncpy(sys_type, sys_field[1], 5); + grpinfo_index = siteinfo_index; - /*sys_type = sys_field[1]; */ /*printf("systype = %s\n", sys_type); */ - /*printf("trunkinfo_index = %i\n", trunkinfo_index); */ + /*printf("sys_index = %i\n", sys_index); */ - /* We're using the Forward System Index field for getting the - * next System Info address. Set this after we set the above variables. */ - //sys_index = atoi(sys_field[13]); - sys_index = next_system_index; - /* TRN */ /* While System has Trunked Systems, then print them. * @@ -2343,13 +2434,13 @@ * variable. * * We only get Site Info, as well as trunked frequencies, - * if the system is not conv type */ - /*printf("systype = %s trunkinfo_index = %i\n", sys_type, - trunkinfo_index); */ - /*TODO: trunkinfo_index -- used orig name. Might want to rename it. */ - if (trunkinfo_index != -1 && strncmp(sys_type, "CNV", 3) != 0 + * if the system is not a conventional type */ + /*printf("systype = %s sys_index = %i\n", sys_type, + sys_index); */ + + if (sys_index != -1 && strncmp(sys_type, "CNV", 3) != 0 && strncmp(sys_type, "LTR", 3) != 0) - grpinfo_index = get_trunk_info(fd, trunkinfo_index); + grpinfo_index = get_trunk_info(fd, sys_index); /* GIN */ /* While System has Groups, then print them. @@ -2365,20 +2456,19 @@ next_group_index = get_group_info(fd, grpinfo_index, channel_index); - /* We're using the Forward Group Index field for getting - * the next Group Info address. */ - grpinfo_index = next_group_index; - - /* Set our starting channel address index from GIN info */ + /* Set our starting channel address index from GIN info - Reduced atoi usage. */ chaninfo_index = atoi(channel_index); - tgidinfo_index = atoi(channel_index); + tgidinfo_index = chaninfo_index; /* CIN */ /* While Group has Channels, and System Type is Conventional, then print them. * Else they're treated like Trunk Group ID's. */ /*printf(" (Channel Starting Location: %s Channel Ending Location: %s)\n", grp_field[8], grp_field[9]; */ - /*chaninfo_index = atoi (grp_field[8]); */ int next_channel_index = 0; + + /* We're using the Forward Group Index field for getting + * the next Group Info address. */ + grpinfo_index = next_group_index; while (chaninfo_index != -1 && (strncmp(sys_type, "CNV", 3) == 0 @@ -2390,12 +2480,11 @@ /* We're using the Forward Channel Index field for getting * the next Channel Info address. */ - //chaninfo_index = atoi(chan_field[12]); chaninfo_index = next_channel_index; } /* TIN */ - /* While system is not convention, then get Trunk Group ID info. */ + /* While system is not conventional, then get Trunk Group ID info. */ /*printf(" (TGID Starting Location: %s TGID Ending Location: %s)\n", tgid_field[8], tgid_field[9]; */ /*printf("systype = %s\n", sys_type); */ int next_tgidinfo_index = 0; @@ -2408,9 +2497,16 @@ /* We're using the Forward Trunk Group ID Info Index field for getting * the next Trunk Group ID info address. */ - //tgidinfo_index = atoi(tgid_field[8]); tgidinfo_index = next_tgidinfo_index; } + + /* GLI & SLI */ + /* If a system is not conventional, then get all L/O TGIDs and Search L/O TGIDs for the System */ + if (strncmp(sys_type, "CNV", 3) != 0 && strncmp(sys_type, "LTR", 3) != 0) + { + get_lockout_tgid(fd, sys_index); + get_search_lockout_tgid(fd, sys_index); + } } /* SIF */ @@ -2419,10 +2515,7 @@ * if the System is not Conv Type * * (Site Info shares the first Group's address for some - * odd/undocumented reason - memory layout?) - * - * Set our grpinfo variable before getting site info because - * these are pointers and Site Info will overwrite it's variable! */ + * odd/undocumented reason. Documentation error with index locations?) */ char trunk_freq_index[10]; int next_site_index = 0; @@ -2437,30 +2530,32 @@ /* Set other variables for sub-commands */ trunkfreq_index = atoi(trunk_freq_index); - motbandplan_index = siteinfo_index; - apcobandplan_index = siteinfo_index; - /* We're using the Forward Site Info Index field for - * getting the next Site Info address. */ - siteinfo_index = next_site_index; - /* MBP *Only if it's a trunked MU2 or MV2 site, * and get this info before trunk freqs. */ if (strncmp(site_type, "MU2", 3) == 0 || strncmp(site_type, "MV2", 3) == 0) - get_motorola_band_plan(fd, motbandplan_index); + get_motorola_band_plan(fd, siteinfo_index); /* APB * If trunked MP25 site, get this info. */ if (strncmp(site_type, "MP25", 4) == 0) - get_apco25_band_plan(fd, apcobandplan_index); + get_apco25_band_plan(fd, siteinfo_index); /* TFQ * While Sites has Trunk Frequencies, then print them. */ while (trunkfreq_index != -1) trunkfreq_index = get_trunk_freq_info(fd, trunkfreq_index); + + /* We're using the Forward Site Info Index field for + * getting the next Site Info address. */ + siteinfo_index = next_site_index; } + + /* We're using the Forward System Index field for getting the + * next System Info address. Set this after all other variables get sys_index! */ + sys_index = next_sys_index; } /* Get Location Alert Settings Modified: src/commands.h =================================================================== --- src/commands.h 2007-11-06 01:37:19 UTC (rev 139) +++ src/commands.h 2007-11-10 21:40:39 UTC (rev 140) @@ -109,8 +109,8 @@ /* End Scan Settings Commands */ -/*int get_lockout_tgid(int fd, int system_index);*/ -/*int get_search_lockout_tgid(int fd, int system_index);*/ +int get_lockout_tgid(int fd, int system_index); +int get_search_lockout_tgid(int fd, int system_index); /*int unlock_tgid(int fd, int system_index); int lockout_tgid(int fd, int system_index); int reverse_index(int fd, int index); @@ -177,7 +177,7 @@ int fw_mode_program(int fd); -/* Elongated Functions - Using above lower-level scanner command functions */ +/* Higher Level Functions using above lower level scanner commands */ int dump(int fd, FILE *outfile); int load_firmware(int fd, FILE *infile); int load(int fd, FILE *infile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-11-06 01:37:23
|
Revision: 139 http://dsctl.svn.sourceforge.net/dsctl/?rev=139&view=rev Author: roger-linux Date: 2007-11-05 17:37:19 -0800 (Mon, 05 Nov 2007) Log Message: ----------- commands.h - Corrected spacing/syntax config.h - Removed sctl related models firmware-work.c - ? Changed something, probably syntax related. Modified Paths: -------------- firmware-work.c src/commands.h src/config.h Modified: firmware-work.c =================================================================== --- firmware-work.c 2007-08-07 02:25:29 UTC (rev 138) +++ firmware-work.c 2007-11-06 01:37:19 UTC (rev 139) @@ -1,3 +1,5 @@ +// Remember! I have a timeout set in serial.c to timeout after a few seconds of serial inactivity (giving the user the option to simply ctrl-c the dsctl process instead of being locked into using kill). The exceptions are while loading or dumping when I've increased this to ~20 seconds. For 115200bps, this seems adequate. However, if you're using 9600bps, the dump/load will incremently increase, hence, an agorythm needs to be implemented to account for the different used connection speeds for the serial port. And, with the "firmware load", loading can take up to 15 minutes. So, account for this when implementing the below functions. + /*********************************************************************** * Firmware Mode Get Model Info ***********************************************************************/ Modified: src/commands.h =================================================================== --- src/commands.h 2007-08-07 02:25:29 UTC (rev 138) +++ src/commands.h 2007-11-06 01:37:19 UTC (rev 139) @@ -39,7 +39,7 @@ /*********************************************************************** * Function Declarations ***********************************************************************/ -/* TODO: Copy code from commands.c / Implement below functions */ +/* TODO: Finish implementing commented-out functions below */ void get_current_tgid_status(int fd); int push_key(int fd, char key_code, char key_mode); @@ -51,35 +51,33 @@ int enter_prg_mode(int fd); int exit_prg_mode(int fd); -int get_backlight(int fd); +int get_backlight(int fd); /*int set_backlight(int fd, char **parsed_line);*/ + int clear_memory(int fd); -int get_key_beep(int fd); +int get_key_beep(int fd); /*int set_key_beep(int fd, char **parsed_line);*/ -int get_opening_message(int fd); +int get_opening_message(int fd); /*int set_opening_message(int fd, char **parsed_line);*/ -int get_priority_mode(int fd); +int get_priority_mode(int fd); /*int set_priority_mode(int fd, char **parsed_line);*/ int get_auto_gain_control(int fd); - /*int set_auto_gain_control(int fd, char **parsed_line);*/ + /* Scan Settings - Goes in order we get/set - Calls Group Index only once instead of twice */ int get_system_count(int fd); int get_system_index_head(int fd); int get_system_index_tail(int fd); int get_system_quick_lockout(int fd); - /*int set_system_quick_lockout(int fd, char **parsed_line);*/ int get_group_quick_lockout(int fd, int system_index); - /*int set_group_quick_lockout(int fd, char **parsed_line);*/ int create_system(int fd, char *system_type); - /*int delete_system(int fd);*/ int get_system_info(int fd, int system_index, char *system_type, char *channel_group_head); @@ -88,13 +86,11 @@ int set_trunk_info(int fd, int system_index, char **parsed_line); int append_channel_group(int fd, int system_index); int append_tgid_group(int fd, int system_index); - - /*int delete_group(int fd, group_index); *//* Use same function for delete_site */ +/*int delete_group(int fd, group_index); *//* Use same function for delete_site */ int get_group_info(int fd, int group_index, char *channel_index); int set_group_info(int fd, int group_index, char **parsed_line); int append_channel_freq(int fd, int group_index); /* Use same function for append_trunk_freq */ int append_tgid(int fd, int group_index); - /*int delete_channel(int fd, channel_index);*/ int get_channel_info(int fd, int channel_index); int set_channel_info(int fd, int channel_index, char **parsed_line); @@ -110,9 +106,9 @@ int set_apco25_band_plan(int fd, int site_index, char **parsed_line); int get_trunk_freq_info(int fd, int channel_index); int set_trunk_freq_info(int fd, int channel_index, char **parsed_line); - /* End Scan Settings Commands */ + /*int get_lockout_tgid(int fd, int system_index);*/ /*int get_search_lockout_tgid(int fd, int system_index);*/ /*int unlock_tgid(int fd, int system_index); @@ -122,72 +118,56 @@ int get_remains_memory_block(int fd); int get_memory_used(int fd); int loc_alert_system_index_head(int fd, char *loc_alert_system_type); - /*int get_loc_alert_system_index_tail(int fd, char *loc_alert_system_type); int create_loc_alert_system(int fd, char *loc_alert_system_type); int delete_loc_alert_system(int loc_alert_system_index);*/ int get_loc_alert_system_info(int fd, int loc_alert_system_index); - /*int set_loc_alert_system_info(int fd, int loc_alert_system_index, char**parsed_line);*/ int get_srch_cc_settings(int fd); - /*int set_srch_cc_settings(int fd, char **parsed_line);*/ int get_bcast_screen_band_settings(int fd); - /*int set_bcast_screen_band_settings(int fd, int bcast_screen_band_settings_index, char **parsed_line);*/ int get_search_key_settings(int fd); - /*int set_search_key_settings(int fd, char **parsed_line); */ int get_global_lockout_freq(int fd); - /* int unlock_global_lockout_freq(int fd, double global_lockout_freq); int lock_out_freq(int fd, double frequency);*/ int get_close_call_settings(int fd); - /*int set_close_call_settings(int fd, char **parsed_line);*/ int get_service_search_settings(int fd); - /*int set_service_search_settings(int fd, int search_index, char **parsed_line);*/ int get_custom_search_group(int fd); - /*int set_custom_search_group(int fd, char **parsed_line);*/ int get_custom_search_settings(int fd); - /*int set_custom_search_settings(int fd, int search_index, char **parsed_line);*/ int get_weather_settings(int fd); - /*int set_weather_setting(int fd, char **parsed_line);*/ int get_same_group_settings(int fd); - /*int set_same_group_settings(int fd, int same_index, char **parsed_line);*/ int get_tone_out_settings(int fd); - /*int set_tone_out_settings(int fd, int tone_out_index, char **parsed_line);*/ int get_lcd_contrast_settings(int fd); - /*int set_lcd_contrast_settings(int fd, char **parsed_line);*/ int get_lcd_upside_down_settings(int fd); - /*int set_lcd_upside_down_settings(int fd, char **parsed_line);*/ int get_scanner_option_settings(int fd); - /*int set_scanner_option_settings(int fd, char **parsed_line); int get_volume_level_settings(int fd); int set_volume_level_settings(int fd, int volume_level); int get_squelch_level_settings(int fd); int set_squelch_level_settings(int fd, int squelch_level);*/ int get_apco_settings(int fd); - /*int set_apco_settings(int fd, char **parsed_line);*/ + /* GPS Related -- I don't have a GPS for this scanner */ int get_gps_display_option(int fd); - /*int set_gps_display_option(int fd, char **parsed_line);*/ int get_gps_gga_data(int fd); /* TODO: Untested! */ int get_gps_rmc_data(int fd); /* TODO: Untested! */ int get_window_voltage(int fd); + /* Undocumented Uniden Firmware Mode Commands */ int fw_mode_model_info(int fd, char *fwm_model); int fw_mode_set_speed(int fd, char *fwm_speed); @@ -196,6 +176,7 @@ int fw_mode_scb(int fd, int scb_value); int fw_mode_program(int fd); + /* Elongated Functions - Using above lower-level scanner command functions */ int dump(int fd, FILE *outfile); int load_firmware(int fd, FILE *infile); Modified: src/config.h =================================================================== --- src/config.h 2007-08-07 02:25:29 UTC (rev 138) +++ src/config.h 2007-11-06 01:37:19 UTC (rev 139) @@ -36,10 +36,6 @@ /* the models we know about */ #define MODELUNKNOWN -1 -//#define BC895XLT 0 -//#define BC245XLT 1 -//#define BC780XLT 2 -//#define PRO2052 3 #define BCD396T 0 #define BCD996T 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-08-07 02:25:32
|
Revision: 138 http://dsctl.svn.sourceforge.net/dsctl/?rev=138&view=rev Author: roger-linux Date: 2007-08-06 19:25:29 -0700 (Mon, 06 Aug 2007) Log Message: ----------- firmware-work.c - Since I'm not going to be developing for a short term, I'm uploading the functions needing to be implemented for firmware load function. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Added Paths: ----------- firmware-work.c Added: firmware-work.c =================================================================== --- firmware-work.c (rev 0) +++ firmware-work.c 2007-08-07 02:25:29 UTC (rev 138) @@ -0,0 +1,216 @@ +/*********************************************************************** +* Firmware Mode Get Model Info +***********************************************************************/ +int fwmode_get_model_info(int fd, char *fwmode_model) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*MDL"); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + /* TODO: Some compatible scanners use "MOT" */ + check_err(command, answer); + + printf("%s\n", answer); + strcpy(fwmode_model, answer); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Set Speed +***********************************************************************/ +int fwmode_set_speed(int fd, int fwmode_speed) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*SPD %i", fwmode_speed); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + printf("%s\n", answer); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Set *PGL (NOT KNOWN - Clear Page Memory ???) +***********************************************************************/ +int fwmode_set_pgl(int fd, int fwmode_pgl) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*PGL %i", fwmode_pgl); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + printf("%s\n", answer); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Set *ULE (NOT KNOWN - Unlock EEPROM ???) +***********************************************************************/ +int fwmode_set_ule(int fd) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*ULE"); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + printf("ULE %s\n", answer); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Set *SCB (NOT KNOWN - Send/Return Checksum Bytes ???) +***********************************************************************/ +int fwmode_set_scb(int fd, int fwmode_scb) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*SCB %i", fwmode_scb); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + printf("%s\n", answer); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Enter Program Mode +***********************************************************************/ +int fwmode_set_pgl(int fd, int fwmode_pgl) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*PGL %i", fwmode_pgl); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + printf("Entered Firmware Mode Program Mode\n"); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Send File +***********************************************************************/ +int fwmode_send_file(int fd, char *infile) +{ + /* Push InFile -- Last line "S804000000FB" triggers the + * following: + * "PROGRAM END" + * "CHECKSUM= EC8BH" */ + + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "%s", line); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + + while (fgets(line, MAXLINELEN, infile) != NULL) + { + snprintf(command, 100, "%s", line); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); + } + + /* TODO: Verify returned checksum is good! */ + printf("%s", answer); + + return (0); +} + +/*********************************************************************** +* Firmware Mode Power Cycle +***********************************************************************/ +int fwmode_powercycle(int fd) +{ + char answer[100], command[100]; + + memset(answer, 0, 100); + memset(command, 0, 100); + + snprintf(command, 100, "*OFF"); + /*printf("\nCommand == %s\n", command); */ + do_command(fd, command, answer); + /*printf("%s\n(%i)\n", answer, strlen(answer)); */ + + check_err(command, answer); +} + +/*********************************************************************** +* Load Firmware +***********************************************************************/ +int load_firmware(int fd, int infile) /* blah -- see sync'ed svn version for approp func name! */ +{ + fwmode_get_model_info(fd, fwmode_model); + + if (strcmp(fwmode_model, "bcd996t") == 0) + { + printf("Found BCD996T Model\n"); + /* TODO: Let the user specify custom speed + * SPD = 9600 + * SPD 4 = 57600 + * SPD 5 = 115200 */ + fwmode_set_speed(fd, 5); + + fwmode_set_pgl(fd, 1000000000000000000); + fwmode_set_ule(fd); + fwmode_set_scb(fd, 1); + fwmode_set_prg(fd); + + printf("\nVerify You Want To Load Firmware? (Y/n):"); + if (getchar() == 'Y') + fwmode_send_file(fd, infile); + + printf("Firmware Load Appears Successful, Power Cycling Unit\n"); + fwmode_powercycle(fd); + } + + return (0); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-31 21:20:02
|
Revision: 137 http://dsctl.svn.sourceforge.net/dsctl/?rev=137&view=rev Author: roger-linux Date: 2007-07-31 14:19:58 -0700 (Tue, 31 Jul 2007) Log Message: ----------- Misc arrangements for firwmare upload command. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/commands.h Modified: src/commands.h =================================================================== --- src/commands.h 2007-07-31 09:09:33 UTC (rev 136) +++ src/commands.h 2007-07-31 21:19:58 UTC (rev 137) @@ -39,7 +39,7 @@ /*********************************************************************** * Function Declarations ***********************************************************************/ -/* TODO: Copy code from commands.c or implement uncoded functions */ +/* TODO: Copy code from commands.c / Implement below functions */ void get_current_tgid_status(int fd); int push_key(int fd, char key_code, char key_mode); @@ -188,6 +188,13 @@ int get_gps_rmc_data(int fd); /* TODO: Untested! */ int get_window_voltage(int fd); +/* Undocumented Uniden Firmware Mode Commands */ +int fw_mode_model_info(int fd, char *fwm_model); +int fw_mode_set_speed(int fd, char *fwm_speed); +int fw_mode_pgl(int fd, int pgl_value); +int fw_mode_ule(int fd); +int fw_mode_scb(int fd, int scb_value); +int fw_mode_program(int fd); /* Elongated Functions - Using above lower-level scanner command functions */ int dump(int fd, FILE *outfile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-31 09:09:39
|
Revision: 136 http://dsctl.svn.sourceforge.net/dsctl/?rev=136&view=rev Author: roger-linux Date: 2007-07-31 02:09:33 -0700 (Tue, 31 Jul 2007) Log Message: ----------- Provides footwork for "ie. dsctl firmware BCD996T_V1_03_11.scn" $ hexedit BC_VUP.exe (to get a scenario of what I'm doing) There are four to six special commands (ie. *MDL, *PRG, *ULE, ...) used for uploading the firmware. I've commented the code in commands.c (load_firmware function). Just need to write the minor functions to make it tidy. *Note: Some commands I don't know what they do, so I'm dragging my feet in hopes of figuring out what these commands specifically do so I can write comprehendable code. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/commands.c src/commands.h src/human_commands.c src/human_commands.h src/main.c src/main.h Modified: src/commands.c =================================================================== --- src/commands.c 2007-07-29 05:14:27 UTC (rev 135) +++ src/commands.c 2007-07-31 09:09:33 UTC (rev 136) @@ -2490,6 +2490,39 @@ } /*********************************************************************** +* Load Firmware +***********************************************************************/ +int load_firmware(int fd, FILE *infile) +{ + char line[500]; + + memset(line, 0, 500); + + printf("firmware_load: \n"); + + setup_port(fd, 9600); /* Units use default baud rates in firmware mode! */ + //get_fmodel(fd, model); /* "*MDL" */ + + //if (strcmp(model, "bcd996t") == 0) + //{ + // set_speed(fd, 115200); /* "*SPD int" - Increase baud rate to value*/ + // setup_port(fd, 115200); /* Set our program to the increased baud rate */ + // set_pgl(fd, 1000000000000000000); /* "*PGL int" - Clear Memory ??? */ + // set_ule(fd); /* "*ULE" - Unlock EEPROM ??? */ + // set_scb(fd, 1); /* "*SCB int" - Set Checksum Byte to int ??? */ + // set_prg(fd); /* "*PRG" - Enter program mode - expect a lot of data */ + + /* TODO: Put firmware names and checksums into DEFINES */ + while (fgets(line, MAXLINELEN, infile) != NULL) + { + // read in firmware + // When NULL, scanner unit will return "PROGRAM END" and "CHECKSUM= EC8BH + } + + return (0); +} + +/*********************************************************************** * Load BCD memory from file ***********************************************************************/ /* TODO: Break the following into sections for allowing upload of Modified: src/commands.h =================================================================== --- src/commands.h 2007-07-29 05:14:27 UTC (rev 135) +++ src/commands.h 2007-07-31 09:09:33 UTC (rev 136) @@ -188,9 +188,11 @@ int get_gps_rmc_data(int fd); /* TODO: Untested! */ int get_window_voltage(int fd); + /* Elongated Functions - Using above lower-level scanner command functions */ -int dump(int fd, FILE * outfile); -int load(int fd, FILE * infile); +int dump(int fd, FILE *outfile); +int load_firmware(int fd, FILE *infile); +int load(int fd, FILE *infile); int version(int fd); #endif /* _COMMANDS_H_ */ Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-29 05:14:27 UTC (rev 135) +++ src/human_commands.c 2007-07-31 09:09:33 UTC (rev 136) @@ -70,7 +70,30 @@ } /*********************************************************************** - * key command + * Firmware command + ***********************************************************************/ +void human_do_firmware(int fd, int argc, char **args) +{ + printf("human_do_firmware: \n"); + + FILE *infile; + char errorstr[100]; + + /* Check for File & + * TODO: Check File type and version? */ + if ((infile = fopen(args[0], "r")) != NULL) + load_firmware(fd, infile); + else + { + snprintf(errorstr, 100, "load from \"%s\" failed", args[1]); + perror(errorstr); + return; + } +} + + +/*********************************************************************** + * Key command * TODO: Use switch instead of if statements? Move over key defines to here. ***********************************************************************/ void human_do_key(int fd, int argc, char **args) Modified: src/human_commands.h =================================================================== --- src/human_commands.h 2007-07-29 05:14:27 UTC (rev 135) +++ src/human_commands.h 2007-07-31 09:09:33 UTC (rev 136) @@ -73,6 +73,7 @@ #define K_MODE_RELEASE "R" /* Release and Cancel Hold Key state */ void human_do_dump(int fd, int argc, char **args); +void human_do_firmware(int fd, int argc, char **args); void human_do_key(int fd, int argc, char **args); void human_do_load(int fd, int argc, char **args); void human_do_status(int fd, int argc, char **args); Modified: src/main.c =================================================================== --- src/main.c 2007-07-29 05:14:27 UTC (rev 135) +++ src/main.c 2007-07-31 09:09:33 UTC (rev 136) @@ -294,6 +294,10 @@ case C_DUMP: human_do_dump(fd, cmd_argc, cmd_argv); break; + + case C_FIRMWARE: + human_do_firmware(fd, cmd_argc, cmd_argv); + break; case C_HELP: human_help(fd, cmd_argc, cmd_argv); @@ -334,6 +338,8 @@ if (strncmp(cmd, "du", 2) == 0) return (C_DUMP); + else if (strncmp(cmd, "f", 1) == 0) + return (C_FIRMWARE); else if (strncmp(cmd, "h", 1) == 0) return (C_HELP); else if (strncmp(cmd, "k", 1) == 0) Modified: src/main.h =================================================================== --- src/main.h 2007-07-29 05:14:27 UTC (rev 135) +++ src/main.h 2007-07-31 09:09:33 UTC (rev 136) @@ -46,8 +46,9 @@ #define C_DATA 11 #define C_VERSION 12 #define C_DUMP 13 -#define C_LOAD 14 -#define C_KEY 15 +#define C_FIRMWARE 14 +#define C_LOAD 15 +#define C_KEY 16 /*********************************************************************** * prototypes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-29 05:14:29
|
Revision: 135 http://dsctl.svn.sourceforge.net/dsctl/?rev=135&view=rev Author: roger-linux Date: 2007-07-28 22:14:27 -0700 (Sat, 28 Jul 2007) Log Message: ----------- Commands.txt: Provide documentation on some undocumented BCD996T commands. (Trivial) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Added Paths: ----------- docs/Commands.txt Added: docs/Commands.txt =================================================================== --- docs/Commands.txt (rev 0) +++ docs/Commands.txt 2007-07-29 05:14:27 UTC (rev 135) @@ -0,0 +1,123 @@ +Documented commands can be found on Uniden's Website or else where on the web. +For licensing purposes, I have not included either the BCD396T_Protocol.pdf +or BCD996T_Protocol.pdf within Dsctl. It's possible something within the +first two pages might conflict with GNU Licensing. Too add, I'm not a lawyer +to I don't think I'd do a good job interpreting it! ;-) + +Here are some undocumented commands for the BCD996T (also used for BC246). + +So far, I have commands only used for uploading firmware used within +BC_VUP.exe. These can easily be found using a hexeditor. + +The reason I ventured here, I was having severe problems uploading firmware to +my BCD996T unit. It seems BC_VUP.exe will upload too fast probably +overloading the scanner input bandwidth or overloadin the scanner's cpu +resources. The reason I guess this, sending @115200bps with a "sleep .01" +after each line of text within a *.scn firmware file will give me a successsful +upgrade every time, versus using BC_VUP.exe will seemingly fail everytime with +a checksum error. The first time I upgraded the firmware with BC_VUP.exe, it +took approx. ten tries. Each try with BC_VUP.exe would seem to get better. + +It would be great if somebody could provide further info for the following +commands. However, it's no problem for me to integrate firmware uploading +within Dsctl at the time being. I can only provide support for other units if +I have volunteers to test code. + + +1) Commands used within BC_VUP.exe +2) This is what is returned after firmware has been uploaded +3) Interpretting Firmware Upgrade Process. + + +1) Commands used within BC_VUP.exe + + MOT - Some models might take this command? + + *OFF - Power Cycles the scanner after a firmware upgrade. + + *PGL - Clear memory??? + 10000000000? + 11000000000 (bcd996t) + + *SCB 1 - Unknown + + *SPD - Sets the baud rate 1-5 + 4 = 57600 + 5 = 115200 (bcd996t) + + *SUM - Enable Internal Checksum Calculator??? + + *PRG - Set the scanner in a mode to accept stdin? (ie. Accepts *.scn as input) + After firmware upload (S8040... line within *.scn file triggers end of + file?... + + *ULE - Unknown + + +2) This is what is returned after firmware has been uploaded + + Returns "PROGRAM END" on completion + + Returns "CHECKSUM ERROR" on fail. + Returns "CHECKSUM= 3A73H" on successful upload + + How do we calculate checksums?? + + Approx upload time using a "sleep .01" per each line of text @115200bps + real 14m27.138s + user 1m14.043s + sys 2m15.521s + + +3) Interpretting Firmware Upgrade Process. + + First, check the model of the scanner as the firmware upgrade process is + slightly different with individual models. (Size of Memory, ...) + + Next, set/increase the speed as the default baud rate is 9600bps. This + requires us to disconnect and reset to the increase baud rate. + + From here, I can only guess the memory is cleared. For some models, *SUM + seems to be used to activate a checksum calculator function. It could be + for the bcd996t one of the *ULE, SCB 1 commands might do something + similar. + + Send the Program command which seems to simiple let the scanner know not + to send a return error code on lines >87 characters and/or signal the + large *.scn firmware code is coming. + + The last line of the *.scn firmware file seems to signal the scanner EOF. + + At this point, a checksum value is returned. + +--- Begin of Snip --- +.\xFE +`\xF9 +\xD7y\xEB + +UNKNOWN COMMAND +*MDL +BCD996T +*SPD 5 +SPEED 115200 bps +*PGL 1000000000000000000 +OK +*ULE +OK +*SCB 1 +SCB 1 +*PRG +OK +S00C0000006E480003C4003A73C9 +S214000000545555D5C555C555C555C555C555C5557C +S21400001054557551C555C555C555C555C555C555D0 +S2140000205455754EC555C555C555C555C555C555C3 + ---omitted redundant data--- +S2140CFFC06E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E40 +S2140CFFD06E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E30 +S2140CFFE06E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E20 +S2140CFFF06E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E10 +S804000000FB +PROGRAM END +CHECKSUM= EC8BH +--- End of Snip --- Property changes on: docs/Commands.txt ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-25 05:39:42
|
Revision: 134 http://dsctl.svn.sourceforge.net/dsctl/?rev=134&view=rev Author: roger-linux Date: 2007-07-24 22:39:41 -0700 (Tue, 24 Jul 2007) Log Message: ----------- human_commands.c: FIXED bug where daemon_mode nor ncurses modes would work. commands.c commands.h: indent syntax. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/commands.c src/commands.h src/human_commands.c Modified: src/commands.c =================================================================== --- src/commands.c 2007-07-24 08:32:34 UTC (rev 133) +++ src/commands.c 2007-07-25 05:39:41 UTC (rev 134) @@ -137,7 +137,6 @@ strncpy(field[6], "SCANNING\0", 17); } - /*if (daemon_mode == 0 || osd == 0) { printf("Display Status:\n"); Modified: src/commands.h =================================================================== --- src/commands.h 2007-07-24 08:32:34 UTC (rev 133) +++ src/commands.h 2007-07-25 05:39:41 UTC (rev 134) @@ -89,7 +89,7 @@ int append_channel_group(int fd, int system_index); int append_tgid_group(int fd, int system_index); - /*int delete_group(int fd, group_index); *//* Use same function for delete_site */ + /*int delete_group(int fd, group_index); *//* Use same function for delete_site */ int get_group_info(int fd, int group_index, char *channel_index); int set_group_info(int fd, int group_index, char **parsed_line); int append_channel_freq(int fd, int group_index); /* Use same function for append_trunk_freq */ Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-24 08:32:34 UTC (rev 133) +++ src/human_commands.c 2007-07-25 05:39:41 UTC (rev 134) @@ -181,73 +181,75 @@ ***********************************************************************/ void human_do_status(int fd, int argc, char **args) { + printf("daemon_mode == %i, osd == %i\n", daemon_mode, osd); /* We have three types of displays */ /* FIXME: Display gets corrupt if stuck in prg_mode! */ - while (daemon_mode != 0) + + /* Give the user a repeated scrolling display (daemon) */ + if ((osd == 0) && (daemon_mode == 1)) { - if (osd == 0) + while (osd == 0) /* simple endless loop */ { - /* Give the user a repeated scrolling display (daemon) */ get_current_status(fd); get_reception_status(fd); get_current_tgid_status(fd); sleep(.5); } - else if (osd == 1) - { - /* User wants a live repeated ncurses display. (implies deamon mode) */ - char buf[1024]; - char buf2[30]; - char *ap = buf2; - char *osd_clear, *osd_clear_line, *osd_up, *osd_cr; + } - /* I can't make the cursor invisible :- */ - /*char *osd_invisible, *osd_visible; */ + /* User wants a live repeated ncurses display. (implies deamon mode) */ + else if ((osd == 1) && (daemon_mode == 1)) + { + char buf[1024]; + char buf2[30]; + char *ap = buf2; + char *osd_clear, *osd_clear_line, *osd_up, *osd_cr; - tgetent(buf, getenv("TERM")); + /* I can't make the cursor invisible :- */ + /*char *osd_invisible, *osd_visible; */ - osd_clear = tgetstr("cl", &ap); - osd_clear_line = tgetstr("ce", &ap); - osd_up = tgetstr("up", &ap); - osd_cr = tgetstr("cr", &ap); - /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ - /*osd_invisible = tgetstr("vi", &ap); */ - /*osd_visible = tgetstr("ve", &ap); */ + tgetent(buf, getenv("TERM")); - while (osd == 0) /* simple endless loop */ - { - int i = 0; + osd_clear = tgetstr("cl", &ap); + osd_clear_line = tgetstr("ce", &ap); + osd_up = tgetstr("up", &ap); + osd_cr = tgetstr("cr", &ap); + /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ + /*osd_invisible = tgetstr("vi", &ap); */ + /*osd_visible = tgetstr("ve", &ap); */ - if (debug > 0) - printf("osd value == %i\n", osd); + while (osd == 1) /* simple endless loop */ + { + int i = 0; - fputs(osd_clear_line, stdout); - fputs(osd_clear_line, stdout); - get_current_status(fd); - printf("\n"); + if (debug > 0) + printf("osd value == %i\n", osd); - fputs(osd_clear_line, stdout); - get_reception_status(fd); - printf("\n"); + fputs(osd_clear_line, stdout); + fputs(osd_clear_line, stdout); + get_current_status(fd); + printf("\n"); - fputs(osd_clear_line, stdout); - get_current_tgid_status(fd); - /* FIXME: Want cursor to be invisible! Also see leaveok() */ - /*fputs(osd_invisible, stdout); */ + fputs(osd_clear_line, stdout); + get_reception_status(fd); + printf("\n"); - for (i = 1; i <= 6; i++) - fputs(osd_up, stdout); + fputs(osd_clear_line, stdout); + get_current_tgid_status(fd); + /* FIXME: Want cursor to be invisible! Also see leaveok() */ + /*fputs(osd_invisible, stdout); */ - curs_set(0); - sleep(.5); - } + for (i = 1; i <= 6; i++) + fputs(osd_up, stdout); + + curs_set(0); + sleep(.5); } - } /* Just print once & exit */ - if (daemon_mode == 0) + else { get_current_status(fd); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-24 08:32:37
|
Revision: 133 http://dsctl.svn.sourceforge.net/dsctl/?rev=133&view=rev Author: roger-linux Date: 2007-07-24 01:32:34 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Makefile.am src/Makefile.am: Added *.h source files ... get do without them for building! Rest is ./autogen changes. I am aware for some reason, -n (ncurses) as well as -d is now defunct. (FIXME) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- Makefile.am Makefile.in autom4te.cache/output.0 autom4te.cache/output.1 autom4te.cache/requests autom4te.cache/traces.0 autom4te.cache/traces.1 configure configure.in src/Makefile.am src/Makefile.in Modified: Makefile.am =================================================================== --- Makefile.am 2007-07-24 02:56:27 UTC (rev 132) +++ Makefile.am 2007-07-24 08:32:34 UTC (rev 133) @@ -1 +1,5 @@ SUBDIRS = src/ + +# This adds some extra files not usually included by autoconfig/autogen +# and are particular to this source code. +EXTRA_DIST = docs utils BUGS Dsctl.anjuta LICENSE TODO.tasks Modified: Makefile.in =================================================================== --- Makefile.in 2007-07-24 02:56:27 UTC (rev 132) +++ Makefile.in 2007-07-24 08:32:34 UTC (rev 133) @@ -151,6 +151,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src/ + +# This adds some extra files not usually included by autoconfig/autogen +# and are particular to this source code. +EXTRA_DIST = docs utils BUGS Dsctl.anjuta LICENSE TODO.tasks all: all-recursive .SUFFIXES: Modified: autom4te.cache/output.0 =================================================================== --- autom4te.cache/output.0 2007-07-24 02:56:27 UTC (rev 132) +++ autom4te.cache/output.0 2007-07-24 08:32:34 UTC (rev 133) @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.61 for dsctl 0.1.1. +@%:@ Generated by GNU Autoconf 2.61 for dsctl 0.2.0. @%:@ @%:@ Report bugs to <http://sourceforge.net/projects/dsctl/>. @%:@ @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='dsctl' PACKAGE_TARNAME='dsctl' -PACKAGE_VERSION='0.1.1' -PACKAGE_STRING='dsctl 0.1.1' +PACKAGE_VERSION='0.2.0' +PACKAGE_STRING='dsctl 0.2.0' PACKAGE_BUGREPORT='http://sourceforge.net/projects/dsctl/' # Factoring default headers for most tests. @@ -1206,7 +1206,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dsctl 0.1.1 to adapt to many kinds of systems. +\`configure' configures dsctl 0.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1272,7 +1272,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dsctl 0.1.1:";; + short | recursive ) echo "Configuration of dsctl 0.2.0:";; esac cat <<\_ACEOF @@ -1356,7 +1356,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dsctl configure 0.1.1 +dsctl configure 0.2.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1370,7 +1370,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dsctl $as_me 0.1.1, which was +It was created by dsctl $as_me 0.2.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2060,7 +2060,7 @@ # Define the identity of the package. PACKAGE=dsctl - VERSION=1.0 + VERSION=0.2.0 cat >>confdefs.h <<_ACEOF @@ -4951,7 +4951,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dsctl $as_me 0.1.1, which was +This file was extended by dsctl $as_me 0.2.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4998,7 +4998,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -dsctl config.status 0.1.1 +dsctl config.status 0.2.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: autom4te.cache/output.1 =================================================================== --- autom4te.cache/output.1 2007-07-24 02:56:27 UTC (rev 132) +++ autom4te.cache/output.1 2007-07-24 08:32:34 UTC (rev 133) @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.61 for dsctl 0.1.1. +@%:@ Generated by GNU Autoconf 2.61 for dsctl 0.2.0. @%:@ @%:@ Report bugs to <http://sourceforge.net/projects/dsctl/>. @%:@ @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='dsctl' PACKAGE_TARNAME='dsctl' -PACKAGE_VERSION='0.1.1' -PACKAGE_STRING='dsctl 0.1.1' +PACKAGE_VERSION='0.2.0' +PACKAGE_STRING='dsctl 0.2.0' PACKAGE_BUGREPORT='http://sourceforge.net/projects/dsctl/' # Factoring default headers for most tests. @@ -1206,7 +1206,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dsctl 0.1.1 to adapt to many kinds of systems. +\`configure' configures dsctl 0.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1272,7 +1272,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dsctl 0.1.1:";; + short | recursive ) echo "Configuration of dsctl 0.2.0:";; esac cat <<\_ACEOF @@ -1356,7 +1356,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dsctl configure 0.1.1 +dsctl configure 0.2.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1370,7 +1370,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dsctl $as_me 0.1.1, which was +It was created by dsctl $as_me 0.2.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2060,7 +2060,7 @@ # Define the identity of the package. PACKAGE=dsctl - VERSION=1.0 + VERSION=0.2.0 cat >>confdefs.h <<_ACEOF @@ -4951,7 +4951,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dsctl $as_me 0.1.1, which was +This file was extended by dsctl $as_me 0.2.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4998,7 +4998,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -dsctl config.status 0.1.1 +dsctl config.status 0.2.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: autom4te.cache/requests =================================================================== --- autom4te.cache/requests 2007-07-24 02:56:27 UTC (rev 132) +++ autom4te.cache/requests 2007-07-24 08:32:34 UTC (rev 133) @@ -80,15 +80,15 @@ 'configure.in' ], { + '_LT_AC_TAGCONFIG' => 1, 'AM_PROG_F77_C_O' => 1, - '_LT_AC_TAGCONFIG' => 1, + 'AC_INIT' => 1, 'm4_pattern_forbid' => 1, - 'AC_INIT' => 1, 'AC_CANONICAL_TARGET' => 1, + 'AC_SUBST' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_SUBST' => 1, + 'AC_FC_SRCEXT' => 1, 'AC_CANONICAL_HOST' => 1, - 'AC_FC_SRCEXT' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, @@ -96,8 +96,8 @@ 'LT_CONFIG_LTDL_DIR' => 1, 'AC_REQUIRE_AUX_FILE' => 1, 'AC_CONFIG_LINKS' => 1, + 'm4_sinclude' => 1, 'LT_SUPPORTED_TAG' => 1, - 'm4_sinclude' => 1, 'AM_MAINTAINER_MODE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, '_m4_warn' => 1, @@ -114,11 +114,11 @@ 'AH_OUTPUT' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AC_CONFIG_AUX_DIR' => 1, + 'sinclude' => 1, + 'm4_pattern_allow' => 1, 'AM_PROG_CC_C_O' => 1, - 'm4_pattern_allow' => 1, - 'sinclude' => 1, + 'AC_CANONICAL_SYSTEM' => 1, 'AM_CONDITIONAL' => 1, - 'AC_CANONICAL_SYSTEM' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'm4_include' => 1, Modified: autom4te.cache/traces.0 =================================================================== --- autom4te.cache/traces.0 2007-07-24 02:56:27 UTC (rev 132) +++ autom4te.cache/traces.0 2007-07-24 08:32:34 UTC (rev 133) @@ -536,7 +536,7 @@ m4trace:configure.in:1: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.in:1: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.in:1: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.in:2: -1- AM_INIT_AUTOMAKE([dsctl], [1.0]) +m4trace:configure.in:2: -1- AM_INIT_AUTOMAKE([dsctl], [0.2.0]) m4trace:configure.in:2: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.in:2: -1- AM_SET_CURRENT_AUTOMAKE_VERSION m4trace:configure.in:2: -1- AM_AUTOMAKE_VERSION([1.10]) Modified: autom4te.cache/traces.1 =================================================================== --- autom4te.cache/traces.1 2007-07-24 02:56:27 UTC (rev 132) +++ autom4te.cache/traces.1 2007-07-24 08:32:34 UTC (rev 133) @@ -1,4 +1,4 @@ -m4trace:configure.in:1: -1- AC_INIT([dsctl], [0.1.1], [http://sourceforge.net/projects/dsctl/]) +m4trace:configure.in:1: -1- AC_INIT([dsctl], [0.2.0], [http://sourceforge.net/projects/dsctl/]) m4trace:configure.in:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.in:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.in:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) @@ -139,7 +139,7 @@ m4trace:configure.in:1: -1- AC_SUBST([target_alias]) m4trace:configure.in:1: -1- AC_SUBST_TRACE([target_alias]) m4trace:configure.in:1: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.in:2: -1- AM_INIT_AUTOMAKE([dsctl], [1.0]) +m4trace:configure.in:2: -1- AM_INIT_AUTOMAKE([dsctl], [0.2.0]) m4trace:configure.in:2: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.in:2: -1- AM_AUTOMAKE_VERSION([1.10]) m4trace:configure.in:2: -1- AC_REQUIRE_AUX_FILE([install-sh]) @@ -162,7 +162,7 @@ m4trace:configure.in:2: -1- AC_SUBST([PACKAGE], [dsctl]) m4trace:configure.in:2: -1- AC_SUBST_TRACE([PACKAGE]) m4trace:configure.in:2: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.in:2: -1- AC_SUBST([VERSION], [1.0]) +m4trace:configure.in:2: -1- AC_SUBST([VERSION], [0.2.0]) m4trace:configure.in:2: -1- AC_SUBST_TRACE([VERSION]) m4trace:configure.in:2: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.in:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) Modified: configure =================================================================== --- configure 2007-07-24 02:56:27 UTC (rev 132) +++ configure 2007-07-24 08:32:34 UTC (rev 133) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for dsctl 0.1.1. +# Generated by GNU Autoconf 2.61 for dsctl 0.2.0. # # Report bugs to <http://sourceforge.net/projects/dsctl/>. # @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='dsctl' PACKAGE_TARNAME='dsctl' -PACKAGE_VERSION='0.1.1' -PACKAGE_STRING='dsctl 0.1.1' +PACKAGE_VERSION='0.2.0' +PACKAGE_STRING='dsctl 0.2.0' PACKAGE_BUGREPORT='http://sourceforge.net/projects/dsctl/' # Factoring default headers for most tests. @@ -1206,7 +1206,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dsctl 0.1.1 to adapt to many kinds of systems. +\`configure' configures dsctl 0.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1272,7 +1272,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dsctl 0.1.1:";; + short | recursive ) echo "Configuration of dsctl 0.2.0:";; esac cat <<\_ACEOF @@ -1356,7 +1356,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dsctl configure 0.1.1 +dsctl configure 0.2.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1370,7 +1370,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dsctl $as_me 0.1.1, which was +It was created by dsctl $as_me 0.2.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2060,7 +2060,7 @@ # Define the identity of the package. PACKAGE=dsctl - VERSION=1.0 + VERSION=0.2.0 cat >>confdefs.h <<_ACEOF @@ -4951,7 +4951,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dsctl $as_me 0.1.1, which was +This file was extended by dsctl $as_me 0.2.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4998,7 +4998,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -dsctl config.status 0.1.1 +dsctl config.status 0.2.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: configure.in =================================================================== --- configure.in 2007-07-24 02:56:27 UTC (rev 132) +++ configure.in 2007-07-24 08:32:34 UTC (rev 133) @@ -1,5 +1,5 @@ -AC_INIT(dsctl, 0.1.1, http://sourceforge.net/projects/dsctl/) -AM_INIT_AUTOMAKE(dsctl,1.0) +AC_INIT(dsctl, 0.2.0, http://sourceforge.net/projects/dsctl/) +AM_INIT_AUTOMAKE(dsctl,0.2.0) AC_PROG_CC AC_PROG_INSTALL dnl AC_CHECK_LIB(ncurses) Modified: src/Makefile.am =================================================================== --- src/Makefile.am 2007-07-24 02:56:27 UTC (rev 132) +++ src/Makefile.am 2007-07-24 08:32:34 UTC (rev 133) @@ -6,5 +6,8 @@ dsctl_LDADD = $(LDADD) -lncurses #endif -dsctl_SOURCES = commands.c human_commands.c main.c serial.c usage.c utils.c +# List all sources need to build here! +dsctl_SOURCES = commands.c human_commands.c main.c serial.c usage.c \ + utils.c commands.h config.h human_commands.h main.h \ + serial.h usage.h utils.h Modified: src/Makefile.in =================================================================== --- src/Makefile.in 2007-07-24 02:56:27 UTC (rev 132) +++ src/Makefile.in 2007-07-24 08:32:34 UTC (rev 133) @@ -148,7 +148,12 @@ #ifndef _NCURSES_H dsctl_LDADD = $(LDADD) -lncurses #endif -dsctl_SOURCES = commands.c human_commands.c main.c serial.c usage.c utils.c + +# List all sources need to build here! +dsctl_SOURCES = commands.c human_commands.c main.c serial.c usage.c \ + utils.c commands.h config.h human_commands.h main.h \ + serial.h usage.h utils.h + all: all-am .SUFFIXES: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-24 02:56:29
|
Revision: 132 http://dsctl.svn.sourceforge.net/dsctl/?rev=132&view=rev Author: roger-linux Date: 2007-07-23 19:56:27 -0700 (Mon, 23 Jul 2007) Log Message: ----------- Prep for release of 0.2.0. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/config.h Modified: src/config.h =================================================================== --- src/config.h 2007-07-21 22:02:43 UTC (rev 131) +++ src/config.h 2007-07-24 02:56:27 UTC (rev 132) @@ -59,7 +59,7 @@ #define MAXLINELEN 1024 /* version number of sctl software */ -#define INTERNAL_VERSION "0.1.1" +#define INTERNAL_VERSION "0.2.0" /* dump/load file format version */ #define FFVERSION "1" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-21 22:02:50
|
Revision: 131 http://dsctl.svn.sourceforge.net/dsctl/?rev=131&view=rev Author: roger-linux Date: 2007-07-21 15:02:43 -0700 (Sat, 21 Jul 2007) Log Message: ----------- Renamed a variable (Trivial) Added a TODO items to the BUGS file. (I don't know xml for editing the TODO.xml file!) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- BUGS src/human_commands.c Modified: BUGS =================================================================== --- BUGS 2007-07-21 17:30:42 UTC (rev 130) +++ BUGS 2007-07-21 22:02:43 UTC (rev 131) @@ -1,6 +1,35 @@ This file contains a list of known bugs and inefficiencies. ----------------------------------------------------------- -All known bugs have been fixed at this point. Please submit bugs to sourceforge -if you find any. Thanks. +Please submit bugs to the sourceforge mailing list if you +find any. Thanks. +1) "#ifdef, #include <termcap.h>, #include <ncurses.h>, +#include <curses.h> are not tested on non-ncurses based +systems. + +2) Console output needs more simplified output instead of +my raw output. + +3) Load command needs to be finished. Dump & Load need +more extensive testing. + +4) Needs a user interface for writing systems and system +data. Once this is done, ensure dump & load command co- +exist with the data layout nicely. + +5) Dump & Load from file instead of stdout. This should +dump system's data to each specifically named system named +file, and then can be loaded one at a time by the load +command. + +6) How about a true daemon mode for an init process? +Should also write a pid file as the unit cannot handle more +then one command request. Else, if two processes are +activated at the same time, the first will hang and the +second will output incomplete data from the scanner. + + +Grep TODO & FIXME for other little issues I've yet to +negate! + Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-21 17:30:42 UTC (rev 130) +++ src/human_commands.c 2007-07-21 22:02:43 UTC (rev 131) @@ -202,6 +202,7 @@ char *ap = buf2; char *osd_clear, *osd_clear_line, *osd_up, *osd_cr; + /* I can't make the cursor invisible :- */ /*char *osd_invisible, *osd_visible; */ tgetent(buf, getenv("TERM")); @@ -214,7 +215,7 @@ /*osd_invisible = tgetstr("vi", &ap); */ /*osd_visible = tgetstr("ve", &ap); */ - while (daemon_mode != 0) /* simple endless loop */ + while (osd == 0) /* simple endless loop */ { int i = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-21 17:30:45
|
Revision: 130 http://dsctl.svn.sourceforge.net/dsctl/?rev=130&view=rev Author: roger-linux Date: 2007-07-21 10:30:42 -0700 (Sat, 21 Jul 2007) Log Message: ----------- Fixed osd status with adding another clear line. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/human_commands.c Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-21 06:12:17 UTC (rev 129) +++ src/human_commands.c 2007-07-21 17:30:42 UTC (rev 130) @@ -222,6 +222,7 @@ printf("osd value == %i\n", osd); fputs(osd_clear_line, stdout); + fputs(osd_clear_line, stdout); get_current_status(fd); printf("\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-21 06:12:22
|
Revision: 129 http://dsctl.svn.sourceforge.net/dsctl/?rev=129&view=rev Author: roger-linux Date: 2007-07-20 23:12:17 -0700 (Fri, 20 Jul 2007) Log Message: ----------- get_recept_status: write_metadata: This makes for a working Icecast/Ices2 implementation. Example: ./dsctl -i 30653 -n status (-i [ices pid], -h for more info) Dsctl currently reports metadata about the current reception hit to ~/.dsctl/metadata file with or without specifying -i. key_press: Fixed bug with press type. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/commands.c src/commands.h src/human_commands.c src/main.c src/main.h src/serial.c src/usage.c src/utils.c src/utils.h Modified: src/commands.c =================================================================== --- src/commands.c 2007-07-21 03:04:49 UTC (rev 128) +++ src/commands.c 2007-07-21 06:12:17 UTC (rev 129) @@ -119,61 +119,66 @@ //replace_chars(field[10], field[10]); /* replace_chars is omitting Sytems Scan status line, so comment out for now */ /*printf("Test replace_chars: %s, %i\n\n\n", field[8], strlen(field[8]); */ - /* Stop the scroll effect of the 6th field SCANNING. - * And preserve the effect for daemon_mode & osd mode. */ - if (daemon_mode == 0 || osd == 0) - { - char first_half[20]; - char second_half[20]; + /* Detect scroll effect of the 6th field SCAN and + * report it to metadata file. + * Preserve the effect for daemon_mode & ncurses osd mode. + * TODO: Also catch "Nothing to Scan", "ID SEARCH", "ID SCAN" + * and send to write_metadata() */ + char first_half[20]; + char second_half[20]; - sscanf(field[6], "%s %s", first_half, second_half); - strcat(second_half, first_half); - if (strncmp(first_half, "SCAN", 4) == 0 || - strncmp(second_half, "SCAN", 4) == 0) + sscanf(field[6], "%s %s", first_half, second_half); + strcat(second_half, first_half); + if (strncmp(first_half, "SCAN", 4) == 0 || + strncmp(second_half, "SCAN", 4) == 0) + { + write_metadata(field[4], "SCANNING", "\0"); + if (daemon_mode == 0 || osd == 0) strncpy(field[6], "SCANNING\0", 17); } + /*if (daemon_mode == 0 || osd == 0) - { - printf("Display Status:\n"); - printf(" %s\n %s\n %s\n %s\n", field[6], field[8], field[10], - field[12]); + { + printf("Display Status:\n"); + printf(" %s\n %s\n %s\n %s\n", field[6], field[8], field[10], + field[12]); - if (atoi(field[14]) == 0) - printf(" Squelch Status: Closed\n"); - else - printf(" Squelch Status: Open\n"); - if (atoi(field[15]) == 0) - printf(" Mute Status: Off\n"); - else - printf(" Mute Status: ON\n"); - if (atoi(field[17]) == 0) - printf(" Weather Alert: None\n"); - else - printf(" Weather Alert: ON for SAME CODE - %s", field[17]); - if (atoi(field[18]) == 0) - printf(" Close Call LED: Off\n"); - else - printf(" Close Call LED: ON\n"); - if (atoi(field[19]) == 0) - printf(" Alert LED: Off\n"); - else - printf(" Alert LED: ON\n"); + if (atoi(field[14]) == 0) + printf(" Squelch Status: Closed\n"); + else + printf(" Squelch Status: Open\n"); + if (atoi(field[15]) == 0) + printf(" Mute Status: Off\n"); + else + printf(" Mute Status: ON\n"); + if (atoi(field[17]) == 0) + printf(" Weather Alert: None\n"); + else + printf(" Weather Alert: ON for SAME CODE - %s", field[17]); + if (atoi(field[18]) == 0) + printf(" Close Call LED: Off\n"); + else + printf(" Close Call LED: ON\n"); + if (atoi(field[19]) == 0) + printf(" Alert LED: Off\n"); + else + printf(" Alert LED: ON\n"); - printf(" Signal Level: %i\n\n", atoi(field[20])); - }*/ + printf(" Signal Level: %i\n\n", atoi(field[20])); + } */ - if (daemon_mode == 0 || osd == 0) - printf("Current Display Status:\n"); - + if (daemon_mode == 0 || osd == 0) + printf("Current Display Status:\n"); + /* We have 23 parsed fields to print for this command */ - for (i = 0; i <= 22; i++) - { - if (i != 0) - printf(","); - printf("%s", field[i]); - } - printf("\n"); + for (i = 0; i <= 22; i++) + { + if (i != 0) + printf(","); + printf("%s", field[i]); + } + printf("\n"); } /*********************************************************************** @@ -195,23 +200,16 @@ if (daemon_mode == 0 || osd == 0) printf("\nReception Status:\n"); - - /* Compare just one field to the external metadata variable and if - * if this field is different, then over metadata file with new data */ - if (strcmp(metadata_title, field[7]) != 0) - { - if (debug > 0) - printf("DEBUG get_reception_status: Data differs. \ - Writing metadata file\n\n\n"); - write_metadata(field[6], field[7]); - strcpy(metadata_title, field[7]); - } + /* If freqency hit, then write_metadta() */ + if (strcmp("\0", field[1]) != 0) + write_metadata(field[5], field[6], field[7]); + /* Send this data to ~/.dsctl/metadata */ //write_metadata(field[6], field[7]); - + /* We have 10 parsed fields to print for this command */ - for (i = 0; i <= 9; i++) + for (i = 0; i <= 8; i++) { if (i != 0) printf(","); Modified: src/commands.h =================================================================== --- src/commands.h 2007-07-21 03:04:49 UTC (rev 128) +++ src/commands.h 2007-07-21 06:12:17 UTC (rev 129) @@ -36,9 +36,6 @@ extern int debug; extern int osd; -extern char metadata_artist[1024]; -extern char metadata_title[1024]; - /*********************************************************************** * Function Declarations ***********************************************************************/ @@ -92,7 +89,7 @@ int append_channel_group(int fd, int system_index); int append_tgid_group(int fd, int system_index); - /*int delete_group(int fd, group_index);*//* Use same function for delete_site */ + /*int delete_group(int fd, group_index); *//* Use same function for delete_site */ int get_group_info(int fd, int group_index, char *channel_index); int set_group_info(int fd, int group_index, char **parsed_line); int append_channel_freq(int fd, int group_index); /* Use same function for append_trunk_freq */ Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-21 03:04:49 UTC (rev 128) +++ src/human_commands.c 2007-07-21 06:12:17 UTC (rev 129) @@ -40,8 +40,8 @@ ***********************************************************************/ void human_do_dump(int fd, int argc, char **args) { - FILE *outfile; - char errorstr[100]; + /*FILE *outfile; + char errorstr[100]; */ /*if (scannermodel == BCD996T) { @@ -50,20 +50,23 @@ } */ /* FIXME: Why is args[0] not NULL??? Commenting out everything - * for now! */ - //if (args[0] == NULL) - dump(fd, stdout); + * for now! Mixed results for "*args[]", treating like strg else + * where or just checking if "== NULL" ... darn pointers!!! + * + * I give up. Commenting out things for now -- BUG:FIXME!*/ + //if (strncmp(args[0], "\0", 1) == 0) + dump(fd, stdout); /*else - { - if ((outfile = fopen(args[0], "w")) != NULL) - dump(fd, outfile); - else - { - snprintf(errorstr, 100, "dump to \"%s\" failed", args[1]); - perror(errorstr); - return; - } - }*/ + { + if ((outfile = fopen(args[0], "w")) != NULL) + dump(fd, outfile); + else + { + snprintf(errorstr, 100, "dump to \"%s\" failed", args[1]); + perror(errorstr); + return; + } + } */ } /*********************************************************************** @@ -133,7 +136,7 @@ usage(C_KEY); /* Get second arg of Key Command */ - if (args[1] == NULL) + if (strncmp(args[1], "\0", 1) == 0) key_mode = 'P'; else if (strncmp(args[1], "p", 1) == 0) key_mode = 'P'; @@ -198,8 +201,9 @@ char buf2[30]; char *ap = buf2; char *osd_clear, *osd_clear_line, *osd_up, *osd_cr; - /*char *osd_invisible, *osd_visible;*/ + /*char *osd_invisible, *osd_visible; */ + tgetent(buf, getenv("TERM")); osd_clear = tgetstr("cl", &ap); @@ -207,8 +211,8 @@ osd_up = tgetstr("up", &ap); osd_cr = tgetstr("cr", &ap); /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ - /*osd_invisible = tgetstr("vi", &ap);*/ - /*osd_visible = tgetstr("ve", &ap);*/ + /*osd_invisible = tgetstr("vi", &ap); */ + /*osd_visible = tgetstr("ve", &ap); */ while (daemon_mode != 0) /* simple endless loop */ { @@ -216,21 +220,21 @@ if (debug > 0) printf("osd value == %i\n", osd); - + fputs(osd_clear_line, stdout); get_current_status(fd); printf("\n"); - + fputs(osd_clear_line, stdout); get_reception_status(fd); printf("\n"); - + fputs(osd_clear_line, stdout); get_current_tgid_status(fd); /* FIXME: Want cursor to be invisible! Also see leaveok() */ - /*fputs(osd_invisible, stdout);*/ + /*fputs(osd_invisible, stdout); */ - for (i = 1; i <= 6 ; i ++) + for (i = 1; i <= 6; i++) fputs(osd_up, stdout); curs_set(0); Modified: src/main.c =================================================================== --- src/main.c 2007-07-21 03:04:49 UTC (rev 128) +++ src/main.c 2007-07-21 06:12:17 UTC (rev 129) @@ -49,13 +49,11 @@ int osd = OSD; /* indicate the user wants ncurses osd */ int ices_pid = 0; - /* Initialize metadata file variables */ - char metadata_artist[1024]; - char metadata_title[1024]; +/* Initialize metadata file variables */ +char metadata_album[1024]; +char metadata_artist[1024]; +char metadata_title[1024]; -// memset(metadata_artist, 0, 1024); -// memset(metadata_title, 0, 1024); - /*********************************************************************** * the main function. ain't it grand? ***********************************************************************/ @@ -74,14 +72,15 @@ char configline[81]; char errorstr[100]; - + memset(serial_port, 0, 20); memset(configline, 0, 81); memset(errorstr, 0, 100); + memset(metadata_album, 0, 1024); memset(metadata_artist, 0, 1024); memset(metadata_title, 0, 1024); - + cmd_loc = 1; cmd_arg_loc = 2; @@ -179,7 +178,7 @@ } /* Remove "/config" from HOME enviroment variable */ reset_env_var("HOME", "/config"); - + fclose(configfile); closedir(configfolder); @@ -214,12 +213,11 @@ else if (strcmp(argv[i], "-i") == 0 || strcmp(argv[i], "--icespid") == 0) /* daemon mode */ { ices_pid = atoi(argv[++i]); - + cmd_loc += 2; cmd_arg_loc += 2; } - else if (strcmp(argv[i], "-n") == 0 || strcmp(argv[i], "--ncurses") == 0) /* osd */ { daemon_mode = 1; Modified: src/main.h =================================================================== --- src/main.h 2007-07-21 03:04:49 UTC (rev 128) +++ src/main.h 2007-07-21 06:12:17 UTC (rev 129) @@ -24,6 +24,7 @@ #ifndef _MAIN_H_ #define _MAIN_H_ +extern char metadata_album[1024]; extern char metadata_artist[1024]; extern char metadata_title[1024]; Modified: src/serial.c =================================================================== --- src/serial.c 2007-07-21 03:04:49 UTC (rev 128) +++ src/serial.c 2007-07-21 06:12:17 UTC (rev 129) @@ -175,12 +175,14 @@ /* Check the serial port for usability */ int retval = 0; + while (retval != 1) { retval = check_port(fd, string); if (retval != 1) - printf("ERROR: read_serial Device disconnected? Incorrect baud rate?\n"); + printf + ("ERROR: read_serial Device disconnected? Incorrect baud rate?\n"); } /* Everything looks good so let's try reading from the port. */ @@ -216,16 +218,16 @@ tcgetattr(fd, &port); /* Testing port for DCD, but nothing changes when scanner is connected or - disconnected :-/ - int status; - ioctl(fd, TIOCMGET, &status);*/ - /*if (status & TIOCSSOFTCAR )*/ - /*printf("DCD %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i \n", status, TIOCM_LE,TIOCM_DTR, TIOCM_RTS, - TIOCM_ST ,TIOCM_SR, TIOCM_CTS, TIOCM_CD,TIOCM_RNG,TIOCM_RI , - TIOCM_DSR, TIOCM_DTR, TIOCM_CAR, TIOCSSOFTCAR);*/ + disconnected :-/ + int status; + ioctl(fd, TIOCMGET, &status); */ + /*if (status & TIOCSSOFTCAR ) */ + /*printf("DCD %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i \n", status, TIOCM_LE,TIOCM_DTR, TIOCM_RTS, + TIOCM_ST ,TIOCM_SR, TIOCM_CTS, TIOCM_CD,TIOCM_RNG,TIOCM_RI , + TIOCM_DSR, TIOCM_DTR, TIOCM_CAR, TIOCSSOFTCAR); */ /*else - printf("NO DCD %i %i \n", status, TIOCM_CAR);*/ - + printf("NO DCD %i %i \n", status, TIOCM_CAR); */ + switch (baud_rate) { case 4800: @@ -283,18 +285,19 @@ chars = strlen(string); bytes = write(fd, string, chars); - + /* Check the serial port for usability */ int retval = 0; + while (retval != 1) { retval = check_port(fd, string); - + if (retval != 1) - printf("ERROR: write_serial Device disconnected? Incorrect baud rate?\n"); + printf + ("ERROR: write_serial Device disconnected? Incorrect baud rate?\n"); } - - + /* Everything looks good so let's try writing to the port. */ if (bytes < 0) { @@ -326,8 +329,8 @@ timeout.tv_sec = 20; /*if (debug == 1) - printf("DEBUG retval: %i timeout.tv_sec: %d \n", retval, - timeout.tv_sec);*/ + printf("DEBUG retval: %i timeout.tv_sec: %d \n", retval, + timeout.tv_sec); */ retval = (select(maxfd, &set, NULL, NULL, &timeout)); @@ -335,13 +338,13 @@ printf("DEBUG retval: %i\n", retval); /*if FD_ISSET(fd, &set) - retval = 1;*/ /* yes. redundant for testing now */ + retval = 1; *//* yes. redundant for testing now */ if (retval == -1 || retval == 0) { errno = ETIME; /* Return the proper error code */ perror("ERROR: returned error code"); } - + return (retval); } Modified: src/usage.c =================================================================== --- src/usage.c 2007-07-21 03:04:49 UTC (rev 128) +++ src/usage.c 2007-07-21 06:12:17 UTC (rev 129) @@ -71,7 +71,8 @@ fprintf(stderr, " 4800, 9600, 19200, 38400, 57600, 115200\n\n"); - fprintf(stderr, " -d --daemon Daemon mode. (Experimental)\n\n"); + fprintf(stderr, + " -d --daemon Daemon mode. (Experimental)\n\n"); fprintf(stderr, " -h --help This help text.\n\n"); @@ -80,15 +81,17 @@ fprintf(stderr, " (bcd models are work in progress and bcd396t needs a tester.)\n\n"); - fprintf(stderr, " -i --icespid Current running Ices's PID. Dsctl will send SIGUSR1 to Ices for\n"); fprintf(stderr, + " -i --icespid Current running Ices's PID. Dsctl will send SIGUSR1 to Ices for\n"); + fprintf(stderr, " rereading ~/.dsctl/metadata. (This file needs to be stated\n"); fprintf(stderr, " within your /etc/ices2/ices-alsa.xml.)\n\n"); - fprintf(stderr, " -n --ncurses Ncurses display. Implies daemon mode (Experimental)\n\n"); - fprintf(stderr, + " -n --ncurses Ncurses display. Implies daemon mode (Experimental)\n\n"); + + fprintf(stderr, " -p --port ie. \"-p /dev/ttyS0\" or \"-p /dev/ttyUSB0\"\n\n"); fprintf(stderr, " -v --verbose Verbose output.\n\n"); Modified: src/utils.c =================================================================== --- src/utils.c 2007-07-21 03:04:49 UTC (rev 128) +++ src/utils.c 2007-07-21 06:12:17 UTC (rev 129) @@ -488,46 +488,62 @@ /*********************************************************************** * Write Metadata File ***********************************************************************/ -void write_metadata(char *artist_field, char *title_field) +void write_metadata(char *album_field, char *artist_field, char *title_field) { char *metadataloc; FILE *metadatafile; - + if (debug > 0) - printf("DEBUG write_metadata(): \"%s\" \"%s\"\n", artist_field, title_field); - - /* Check for $HOME/.dsctl/metadata */ - metadataloc = strcat(getenv("HOME"), "/metadata"); + printf("DEBUG write_metadata(): \"%s\" \"%s\" \"%s\"\n", album_field, + artist_field, title_field); - if ((metadatafile = fopen(metadataloc, "w")) != NULL) - { - fprintf(metadatafile, - "ARTIST=%s\n", artist_field); - fprintf(metadatafile, - "TITLE=%s\n", title_field); - } - else /* unable to write a metadata file. if they don't have write permission + /* Compare just one field to the external metadata variable and if + * this field is different and not NULL, then write metadata file + * with new data. */ + if ((strcmp(metadata_title, title_field) != 0)) + { + if (debug > 0) + printf + ("DEBUG write_metadata: Data differs. Writing metadata file\n"); + + /* Copy char string for comparison on the next call */ + strcpy(metadata_title, title_field); + //printf("metadata_title: %s\n", metadata_title); + //printf("title_field: %s\n", title_field); + + /* Check for $HOME/.dsctl/metadata */ + metadataloc = strcat(getenv("HOME"), "/metadata"); + + if ((metadatafile = fopen(metadataloc, "w")) != NULL) + { + fprintf(metadatafile, "ALBUM=%s\n", album_field); + fprintf(metadatafile, "ARTIST=%s\n", artist_field); + fprintf(metadatafile, "TITLE=%s\n", title_field); + } + else /* unable to write a metadata file. if they don't have write permission on their home directory or something else weird */ - { - metadataloc = strcat("write to ", metadataloc); - perror(metadataloc); - } - - reset_env_var("HOME", "/metadata"); - fclose(metadatafile); + { + metadataloc = strcat("write to ", metadataloc); + perror(metadataloc); + } - /* Find ices pid and send Ices SIGUSR1 so Ices rereads metadata*/ - if (ices_pid != 0) - kill(ices_pid, SIGUSR1); + reset_env_var("HOME", "/metadata"); + fclose(metadatafile); - return; + /* Find ices pid and send Ices SIGUSR1 so Ices rereads metadata */ + if (ices_pid != 0) + kill(ices_pid, SIGUSR1); + + return; + } } + /*********************************************************************** * Reset Enviroment Variables ***********************************************************************/ int reset_env_var(char *env_var, char *remove) { - + char *ptr; ptr = strstr(getenv(env_var), remove); Modified: src/utils.h =================================================================== --- src/utils.h 2007-07-21 03:04:49 UTC (rev 128) +++ src/utils.h 2007-07-21 06:12:17 UTC (rev 129) @@ -28,6 +28,10 @@ extern int debug; extern int ices_pid; +extern char metadata_album[1024]; +extern char metadata_artist[1024]; +extern char metadata_title[1024]; + /* * Uniden's customized Ascii Characters * If not caught or redefined may bork the console! @@ -110,7 +114,7 @@ //int do_parse(char *unparsed, char **parsed); int parse_fields(char *unparsed, char **parsed); int replace_chars(char *bcd_chars, char *common_chars); -void write_metadata(char *artist_field, char *title_field); +void write_metadata(char *album_field, char *artist_field, char *title_field); int reset_env_var(char *env_var, char *remove); #endif /* _UTILS_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-21 03:04:51
|
Revision: 128 http://dsctl.svn.sourceforge.net/dsctl/?rev=128&view=rev Author: roger-linux Date: 2007-07-20 20:04:49 -0700 (Fri, 20 Jul 2007) Log Message: ----------- commands.c: get_reception_status() I've got writing to metadata file fixed to where it *only* writes if one of the fields changed. Once this one field changes, the entire metadata file is overwritten. Seems to work pretty good. I just need to clean it up a bit along with tweaking it to work with Trunk Group ID. *Note: When teh scanner hits a Trunked Freq, if I can remember correctly, the scanner reports trunk group info and not reception status. If I'm wrong <shrugs> then I don't have to tweak and it *just* works. ;-) Here's an example: ("-i" denotes the currently running ices pid -- "ps -ax |grep ices", "-h" for more info.) dsctl -i 30653 -n status Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/commands.c src/commands.h src/human_commands.c src/main.c src/main.h Modified: src/commands.c =================================================================== --- src/commands.c 2007-07-20 10:11:00 UTC (rev 127) +++ src/commands.c 2007-07-21 03:04:49 UTC (rev 128) @@ -188,6 +188,7 @@ memset(answer, 0, 500); memset(field, 0, 100); + do_command(fd, "GLG", answer); /*printf ("%s\n(%i)\n", answer, strlen (answer)); */ parse_fields(answer, field); @@ -195,8 +196,19 @@ if (daemon_mode == 0 || osd == 0) printf("\nReception Status:\n"); + /* Compare just one field to the external metadata variable and if + * if this field is different, then over metadata file with new data */ + if (strcmp(metadata_title, field[7]) != 0) + { + if (debug > 0) + printf("DEBUG get_reception_status: Data differs. \ + Writing metadata file\n\n\n"); + write_metadata(field[6], field[7]); + strcpy(metadata_title, field[7]); + } + /* Send this data to ~/.dsctl/metadata */ - write_metadata(field[6], field[7]); + //write_metadata(field[6], field[7]); /* We have 10 parsed fields to print for this command */ for (i = 0; i <= 9; i++) Modified: src/commands.h =================================================================== --- src/commands.h 2007-07-20 10:11:00 UTC (rev 127) +++ src/commands.h 2007-07-21 03:04:49 UTC (rev 128) @@ -36,6 +36,9 @@ extern int debug; extern int osd; +extern char metadata_artist[1024]; +extern char metadata_title[1024]; + /*********************************************************************** * Function Declarations ***********************************************************************/ Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-20 10:11:00 UTC (rev 127) +++ src/human_commands.c 2007-07-21 03:04:49 UTC (rev 128) @@ -180,7 +180,6 @@ { /* We have three types of displays */ /* FIXME: Display gets corrupt if stuck in prg_mode! */ - while (daemon_mode != 0) { if (osd == 0) Modified: src/main.c =================================================================== --- src/main.c 2007-07-20 10:11:00 UTC (rev 127) +++ src/main.c 2007-07-21 03:04:49 UTC (rev 128) @@ -49,6 +49,13 @@ int osd = OSD; /* indicate the user wants ncurses osd */ int ices_pid = 0; + /* Initialize metadata file variables */ + char metadata_artist[1024]; + char metadata_title[1024]; + +// memset(metadata_artist, 0, 1024); +// memset(metadata_title, 0, 1024); + /*********************************************************************** * the main function. ain't it grand? ***********************************************************************/ @@ -72,6 +79,9 @@ memset(configline, 0, 81); memset(errorstr, 0, 100); + memset(metadata_artist, 0, 1024); + memset(metadata_title, 0, 1024); + cmd_loc = 1; cmd_arg_loc = 2; Modified: src/main.h =================================================================== --- src/main.h 2007-07-20 10:11:00 UTC (rev 127) +++ src/main.h 2007-07-21 03:04:49 UTC (rev 128) @@ -24,6 +24,9 @@ #ifndef _MAIN_H_ #define _MAIN_H_ +extern char metadata_artist[1024]; +extern char metadata_title[1024]; + /*********************************************************************** * command codes ***********************************************************************/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-20 10:11:07
|
Revision: 127 http://dsctl.svn.sourceforge.net/dsctl/?rev=127&view=rev Author: roger-linux Date: 2007-07-20 03:11:00 -0700 (Fri, 20 Jul 2007) Log Message: ----------- human_commands.c: Make Status comments more understandable. (Trivial) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/human_commands.c Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-18 10:58:14 UTC (rev 126) +++ src/human_commands.c 2007-07-20 10:11:00 UTC (rev 127) @@ -178,12 +178,14 @@ ***********************************************************************/ void human_do_status(int fd, int argc, char **args) { + /* We have three types of displays */ /* FIXME: Display gets corrupt if stuck in prg_mode! */ + while (daemon_mode != 0) { if (osd == 0) { - /* User wants repeated no fancy status. */ + /* Give the user a repeated scrolling display (daemon) */ get_current_status(fd); get_reception_status(fd); get_current_tgid_status(fd); @@ -192,7 +194,7 @@ } else if (osd == 1) { - /* User wants ncurses osd! */ + /* User wants a live repeated ncurses display. (implies deamon mode) */ char buf[1024]; char buf2[30]; char *ap = buf2; @@ -205,8 +207,9 @@ osd_clear_line = tgetstr("ce", &ap); osd_up = tgetstr("up", &ap); osd_cr = tgetstr("cr", &ap); + /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ /*osd_invisible = tgetstr("vi", &ap);*/ - /*osd_visible = tgetstr("ve", &ap);*/ /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ + /*osd_visible = tgetstr("ve", &ap);*/ while (daemon_mode != 0) /* simple endless loop */ { @@ -225,7 +228,8 @@ fputs(osd_clear_line, stdout); get_current_tgid_status(fd); - /*fputs(osd_invisible, stdout);*/ /* Want cursor to be invisible! Also see leaveok() */ + /* FIXME: Want cursor to be invisible! Also see leaveok() */ + /*fputs(osd_invisible, stdout);*/ for (i = 1; i <= 6 ; i ++) fputs(osd_up, stdout); @@ -237,7 +241,7 @@ } - /* User just wants status once and no fancy stuff */ + /* Just print once & exit */ if (daemon_mode == 0) { get_current_status(fd); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-18 10:58:16
|
Revision: 126 http://dsctl.svn.sourceforge.net/dsctl/?rev=126&view=rev Author: roger-linux Date: 2007-07-18 03:58:14 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Make reminders of two bugs non-critical bugs. (Trivial) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/human_commands.c Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-18 06:29:26 UTC (rev 125) +++ src/human_commands.c 2007-07-18 10:58:14 UTC (rev 126) @@ -49,6 +49,8 @@ return; } */ + /* FIXME: Why is args[0] not NULL??? Commenting out everything + * for now! */ //if (args[0] == NULL) dump(fd, stdout); /*else @@ -176,6 +178,7 @@ ***********************************************************************/ void human_do_status(int fd, int argc, char **args) { + /* FIXME: Display gets corrupt if stuck in prg_mode! */ while (daemon_mode != 0) { if (osd == 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-18 06:29:33
|
Revision: 125 http://dsctl.svn.sourceforge.net/dsctl/?rev=125&view=rev Author: roger-linux Date: 2007-07-17 23:29:26 -0700 (Tue, 17 Jul 2007) Log Message: ----------- This commits moves ~/.dsctl config file to ~/.dsctl/config and while running, updates ~/.dsctl/metadata with reception status info. Use the -i [pid] and dsctl will give Ices a SIGUSR1 signal for rereading the metadata file. (See -h for instructions.) Lots of bugs to fix, such as dsctl writing to the metadata file every .5 seconds and should only write after determining there's different data within the ~/.dsctl/metadata file. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/commands.c src/human_commands.c src/main.c src/serial.c src/usage.c src/utils.c src/utils.h Modified: src/commands.c =================================================================== --- src/commands.c 2007-07-18 00:19:19 UTC (rev 124) +++ src/commands.c 2007-07-18 06:29:26 UTC (rev 125) @@ -194,7 +194,10 @@ if (daemon_mode == 0 || osd == 0) printf("\nReception Status:\n"); - + + /* Send this data to ~/.dsctl/metadata */ + write_metadata(field[6], field[7]); + /* We have 10 parsed fields to print for this command */ for (i = 0; i <= 9; i++) { Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-18 00:19:19 UTC (rev 124) +++ src/human_commands.c 2007-07-18 06:29:26 UTC (rev 125) @@ -49,9 +49,9 @@ return; } */ - if (args[0] == NULL) + //if (args[0] == NULL) dump(fd, stdout); - else + /*else { if ((outfile = fopen(args[0], "w")) != NULL) dump(fd, outfile); @@ -61,7 +61,7 @@ perror(errorstr); return; } - } + }*/ } /*********************************************************************** @@ -208,7 +208,7 @@ while (daemon_mode != 0) /* simple endless loop */ { int i = 0; - + if (debug > 0) printf("osd value == %i\n", osd); Modified: src/main.c =================================================================== --- src/main.c 2007-07-18 00:19:19 UTC (rev 124) +++ src/main.c 2007-07-18 06:29:26 UTC (rev 125) @@ -47,6 +47,7 @@ int debug = DEBUG; /* debug flag for extra output */ int daemon_mode = 0; /* this should get us a daemon mode */ int osd = OSD; /* indicate the user wants ncurses osd */ +int ices_pid = 0; /*********************************************************************** * the main function. ain't it grand? @@ -166,7 +167,10 @@ } } } - close(configfile); + /* Remove "/config" from HOME enviroment variable */ + reset_env_var("HOME", "/config"); + + fclose(configfile); closedir(configfolder); /* process global options */ @@ -197,6 +201,15 @@ cmd_arg_loc += 1; } + else if (strcmp(argv[i], "-i") == 0 || strcmp(argv[i], "--icespid") == 0) /* daemon mode */ + { + ices_pid = atoi(argv[++i]); + + cmd_loc += 2; + cmd_arg_loc += 2; + } + + else if (strcmp(argv[i], "-n") == 0 || strcmp(argv[i], "--ncurses") == 0) /* osd */ { daemon_mode = 1; Modified: src/serial.c =================================================================== --- src/serial.c 2007-07-18 00:19:19 UTC (rev 124) +++ src/serial.c 2007-07-18 06:29:26 UTC (rev 125) @@ -325,9 +325,9 @@ if (strncmp(string, "CLR", 3) == 0) timeout.tv_sec = 20; - if (debug == 1) + /*if (debug == 1) printf("DEBUG retval: %i timeout.tv_sec: %d \n", retval, - timeout.tv_sec); + timeout.tv_sec);*/ retval = (select(maxfd, &set, NULL, NULL, &timeout)); Modified: src/usage.c =================================================================== --- src/usage.c 2007-07-18 00:19:19 UTC (rev 124) +++ src/usage.c 2007-07-18 06:29:26 UTC (rev 125) @@ -80,6 +80,12 @@ fprintf(stderr, " (bcd models are work in progress and bcd396t needs a tester.)\n\n"); + fprintf(stderr, " -i --icespid Current running Ices's PID. Dsctl will send SIGUSR1 to Ices for\n"); + fprintf(stderr, + " rereading ~/.dsctl/metadata. (This file needs to be stated\n"); + fprintf(stderr, + " within your /etc/ices2/ices-alsa.xml.)\n\n"); + fprintf(stderr, " -n --ncurses Ncurses display. Implies daemon mode (Experimental)\n\n"); fprintf(stderr, Modified: src/utils.c =================================================================== --- src/utils.c 2007-07-18 00:19:19 UTC (rev 124) +++ src/utils.c 2007-07-18 06:29:26 UTC (rev 125) @@ -25,6 +25,10 @@ #include <stdlib.h> #include <string.h> +/* For kill */ +#include <sys/types.h> +#include <signal.h> + #include "config.h" #include "utils.h" @@ -295,7 +299,9 @@ /*********************************************************************** * parse comma seperated values into an array for easy printing. ***********************************************************************/ -/* TODO: Some fields assigned by Uniden are "" (null) and we need to preserve these or else they offset enumating fields */ +/* Some fields assigned by Uniden are "" (null) and we need to preserve + * these or else they offset enumating fields. As such, do_parse is + * deprecated. "parse_fields" preserves these null fields. */ int do_parse(char *unparsed, char **parsed) { int i = 0, strlength = 0; @@ -478,3 +484,54 @@ return (i); } + +/*********************************************************************** + * Write Metadata File + ***********************************************************************/ +void write_metadata(char *artist_field, char *title_field) +{ + char *metadataloc; + FILE *metadatafile; + + if (debug > 0) + printf("DEBUG write_metadata(): \"%s\" \"%s\"\n", artist_field, title_field); + + /* Check for $HOME/.dsctl/metadata */ + metadataloc = strcat(getenv("HOME"), "/metadata"); + + if ((metadatafile = fopen(metadataloc, "w")) != NULL) + { + fprintf(metadatafile, + "ARTIST=%s\n", artist_field); + fprintf(metadatafile, + "TITLE=%s\n", title_field); + } + else /* unable to write a metadata file. if they don't have write permission + on their home directory or something else weird */ + { + metadataloc = strcat("write to ", metadataloc); + perror(metadataloc); + } + + reset_env_var("HOME", "/metadata"); + fclose(metadatafile); + + /* Find ices pid and send Ices SIGUSR1 so Ices rereads metadata*/ + if (ices_pid != 0) + kill(ices_pid, SIGUSR1); + + return; +} +/*********************************************************************** + * Reset Enviroment Variables + ***********************************************************************/ +int reset_env_var(char *env_var, char *remove) +{ + + char *ptr; + + ptr = strstr(getenv(env_var), remove); + strcpy(ptr, "\0"); + + return (0); +} Modified: src/utils.h =================================================================== --- src/utils.h 2007-07-18 00:19:19 UTC (rev 124) +++ src/utils.h 2007-07-18 06:29:26 UTC (rev 125) @@ -26,6 +26,7 @@ extern int scannermodel; extern int debug; +extern int ices_pid; /* * Uniden's customized Ascii Characters @@ -109,5 +110,7 @@ //int do_parse(char *unparsed, char **parsed); int parse_fields(char *unparsed, char **parsed); int replace_chars(char *bcd_chars, char *common_chars); +void write_metadata(char *artist_field, char *title_field); +int reset_env_var(char *env_var, char *remove); #endif /* _UTILS_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-18 00:19:32
|
Revision: 124 http://dsctl.svn.sourceforge.net/dsctl/?rev=124&view=rev Author: roger-linux Date: 2007-07-17 17:19:19 -0700 (Tue, 17 Jul 2007) Log Message: ----------- main.c: Removed comments and added close/closedir after configfile reading. (Trival) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/main.c Modified: src/main.c =================================================================== --- src/main.c 2007-07-18 00:06:06 UTC (rev 123) +++ src/main.c 2007-07-18 00:19:19 UTC (rev 124) @@ -166,9 +166,10 @@ } } } + close(configfile); + closedir(configfolder); /* process global options */ - for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-p") == 0 || strcmp(argv[i], "--port") == 0) /* port */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-18 00:06:11
|
Revision: 123 http://dsctl.svn.sourceforge.net/dsctl/?rev=123&view=rev Author: roger-linux Date: 2007-07-17 17:06:06 -0700 (Tue, 17 Jul 2007) Log Message: ----------- main.c: Check for existing ~/.dsctl file, if it exists, remove it. (I tried moving this puppy to the new ~/.dsctl/config, but this incurred too much code, for the amount of config info currently within the configuration file. So, just make users edit the two simple lines as we probably won't be moving config files for a long time again.) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/main.c Modified: src/main.c =================================================================== --- src/main.c 2007-07-17 23:29:16 UTC (rev 122) +++ src/main.c 2007-07-18 00:06:06 UTC (rev 123) @@ -66,7 +66,7 @@ char configline[81]; char errorstr[100]; - + memset(serial_port, 0, 20); memset(configline, 0, 81); memset(errorstr, 0, 100); @@ -80,7 +80,10 @@ /* Check for $HOME/.dsctl folder */ configfolder_name = strcat(getenv("HOME"), "/.dsctl"); if ((configfolder = opendir(configfolder_name)) == NULL) + mkdir(configfolder_name, 0755); + if (errno == EEXIST) { + unlink(configfolder_name); mkdir(configfolder_name, 0755); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-17 23:29:18
|
Revision: 122 http://dsctl.svn.sourceforge.net/dsctl/?rev=122&view=rev Author: roger-linux Date: 2007-07-17 16:29:16 -0700 (Tue, 17 Jul 2007) Log Message: ----------- main.c: Now reading and creating dsctl config info to and from ~/.dsctl/config (TODO: mmm... have yet to check for pre-existing folder) Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/main.c Modified: src/main.c =================================================================== --- src/main.c 2007-07-17 09:42:31 UTC (rev 121) +++ src/main.c 2007-07-17 23:29:16 UTC (rev 122) @@ -28,6 +28,11 @@ #include <errno.h> #include <ctype.h> +/* For folder open & mkdir */ +#include <sys/stat.h> +#include <sys/types.h> +#include <dirent.h> + #include "config.h" #include "serial.h" #include "commands.h" @@ -41,7 +46,7 @@ * determine how certain commands are given to the scanner */ int debug = DEBUG; /* debug flag for extra output */ int daemon_mode = 0; /* this should get us a daemon mode */ -int osd = OSD; /* indicate the user wants ncurses osd */ +int osd = OSD; /* indicate the user wants ncurses osd */ /*********************************************************************** * the main function. ain't it grand? @@ -50,22 +55,37 @@ { int i, cmd_argc, cmd_loc, cmd_arg_loc; char **cmd_argv; + char serial_port[20]; int baud_rate; + + char *configfolder_name; char *configloc; + DIR *configfolder; + FILE *configfile; + char configline[81]; - FILE *configfile; char errorstr[100]; - bzero(serial_port, 20); + memset(serial_port, 0, 20); + memset(configline, 0, 81); + memset(errorstr, 0, 100); cmd_loc = 1; cmd_arg_loc = 2; + strncat(serial_port, DEFAULT_PORT, 20); /* default port ttyS0 */ baud_rate = DEFAULT_BAUDRATE; /* default baud rate 9600bps */ - /* check ~/.dsctl for configuration information */ - configloc = strcat(getenv("HOME"), "/.dsctl"); + /* Check for $HOME/.dsctl folder */ + configfolder_name = strcat(getenv("HOME"), "/.dsctl"); + if ((configfolder = opendir(configfolder_name)) == NULL) + { + mkdir(configfolder_name, 0755); + } + + /* Check for $HOME/.dsctl/config */ + configloc = strcat(getenv("HOME"), "/config"); if ((configfile = fopen(configloc, "r")) == NULL) { if (errno == ENOENT) /* config file not found -- create it */ @@ -109,7 +129,7 @@ sscanf(configline, "%s %s", configcmd, configvar); if (strcmp(configcmd, "port") == 0) { - bzero(serial_port, 20); + memset(serial_port, 0, 20); strncat(serial_port, configvar, 20); } @@ -150,7 +170,7 @@ { if (strcmp(argv[i], "-p") == 0 || strcmp(argv[i], "--port") == 0) /* port */ { - bzero(serial_port, 20); + memset(serial_port, 0, 20); strncat(serial_port, argv[++i], 20); cmd_loc += 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-17 09:42:33
|
Revision: 121 http://dsctl.svn.sourceforge.net/dsctl/?rev=121&view=rev Author: roger-linux Date: 2007-07-17 02:42:31 -0700 (Tue, 17 Jul 2007) Log Message: ----------- human_commands.c: Trivial: commenting-out visible/invisible ncurses variables for now. We should firsct catch ctrl-c and make the cursor visible or else the user is left with an invisible cursor on exit. Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/human_commands.c Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-17 09:21:01 UTC (rev 120) +++ src/human_commands.c 2007-07-17 09:42:31 UTC (rev 121) @@ -193,7 +193,8 @@ char buf[1024]; char buf2[30]; char *ap = buf2; - char *osd_clear, *osd_clear_line, *osd_up, *osd_cr, *osd_invisible, *osd_visible; + char *osd_clear, *osd_clear_line, *osd_up, *osd_cr; + /*char *osd_invisible, *osd_visible;*/ tgetent(buf, getenv("TERM")); @@ -201,7 +202,7 @@ osd_clear_line = tgetstr("ce", &ap); osd_up = tgetstr("up", &ap); osd_cr = tgetstr("cr", &ap); - osd_invisible = tgetstr("vi", &ap); + /*osd_invisible = tgetstr("vi", &ap);*/ /*osd_visible = tgetstr("ve", &ap);*/ /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ while (daemon_mode != 0) /* simple endless loop */ @@ -226,6 +227,7 @@ for (i = 1; i <= 6 ; i ++) fputs(osd_up, stdout); + curs_set(0); sleep(.5); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rog...@us...> - 2007-07-17 09:21:03
|
Revision: 120 http://dsctl.svn.sourceforge.net/dsctl/?rev=120&view=rev Author: roger-linux Date: 2007-07-17 02:21:01 -0700 (Tue, 17 Jul 2007) Log Message: ----------- human_commands.c: Trying to make the cursor invisible for "dsctl --ncurses status", but running into bugs. :-/ Signed-off-by: Roger <ro...@es...> Acked-by: Roger <ro...@es...> Modified Paths: -------------- src/human_commands.c Modified: src/human_commands.c =================================================================== --- src/human_commands.c 2007-07-17 08:07:31 UTC (rev 119) +++ src/human_commands.c 2007-07-17 09:21:01 UTC (rev 120) @@ -193,7 +193,7 @@ char buf[1024]; char buf2[30]; char *ap = buf2; - char *osd_clear, *osd_clear_line, *osd_up, *osd_cr; + char *osd_clear, *osd_clear_line, *osd_up, *osd_cr, *osd_invisible, *osd_visible; tgetent(buf, getenv("TERM")); @@ -201,6 +201,8 @@ osd_clear_line = tgetstr("ce", &ap); osd_up = tgetstr("up", &ap); osd_cr = tgetstr("cr", &ap); + osd_invisible = tgetstr("vi", &ap); + /*osd_visible = tgetstr("ve", &ap);*/ /* FIXME: Why segfault ??? Should also be defined along w/ "vi"! */ while (daemon_mode != 0) /* simple endless loop */ { @@ -219,13 +221,12 @@ fputs(osd_clear_line, stdout); get_current_tgid_status(fd); - fputs(osd_cr, stdout); - + /*fputs(osd_invisible, stdout);*/ /* Want cursor to be invisible! Also see leaveok() */ + for (i = 1; i <= 6 ; i ++) fputs(osd_up, stdout); sleep(.5); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |