CAM

From PublicWiki
Jump to: navigation, search

Here's of CAM's API, installation instructions and FAQ

CAM ENCODING

BARCODE ENCODING


Form: 0x[addr-32 bits][param-16 bits][form_id-24 bits][protocol-2 bits][unused-1 bit]-0

Action: 0x[param2-32 bits][param1-32 bits][function_id-8 bits][unused-3 bits]-1


NUMERIC URL ENCODING (input using numeric keypad)


[phonenumber*]formid#functionid[#params]

[hostname**]formid#functionid[#params]


CAM API

Dialogs

 // returns true if user hits OK, false otherwise
 bool input_int(string variable, string prompt, string audiofile, int
 imageindex); 
 
 bool input_date(string variable, string prompt, string audiofile, int
 imageindex);
 
 bool input_password(string variable, string prompt, string audiofile, int
 imageindex);
 
 bool input_pin(string variable, string prompt, string audiofile, int
 imageindex);
 
 bool input_phone_number(string variable, string prompt, string audiofile, int
 imageindex); 
 
 bool input_time(string variable, string prompt, string audiofile, int
 imageindex);
 
 bool input_duration(string variable, string prompt, string audiofile, int
 imageindex);
 
 bool input_number(string variable, string prompt, string audiofile, int
 imageindex);
 
 bool input_text(string variable, string prompt, string audiofile, int
 imageindex);  
 
 // launches confirmation dialog (OK / Cancel)
 bool confirmation_note(string prompt, string audiofile, int
 imageindex);
 	
 // launches notification dialog
 void message_note(string prompt, string audiofile, int imageindex);
  

Multimedia

  // prompts the user to take a picture and save it
 void takepicture(string filename, string continuation);
 
  // prompts the user to record audio and save it
 void recordaudio(string filename, string continuation);
 
  // saves the current picture
 void savepicture(string filename, string continuation);
 
  // prompts the user to click a barcode, assigning the value to 
 void clickbarcode(string var, string continuation);
 
  // prompts the user to scan a barcode, assigning the value to 
 void scanbarcode(string var, string continuation);
 

File I/O

 // opens file for writing - overwrites file if it already exists
 bool open_write_file(string filename);
 
 // writes to currently open write file
 void write_file(string text);
 
 // closes currently open write file
 bool close_write_file();
 
 // opens file for reading - returns false if it doesnt exist
 bool open_read_file(string filename);
 
 // reads data into var until delimiter, or 128 chars, whichever is shorter
 // returns false if EOF is reached, or other error
 bool read_file(string var, char delimiter);
 
 // closes currenly open read file
 bool close_read_file();
 

Networking

 // sends HTTP post request, with specified form params       
 void http_post(string URL, string var1, string var2, ...);
 
 // sends http GET request
 void http_get(string URL);

 // sends txt message
 void sms(string phoneNum, string message, string continuation);
 
  // Note: Due to a bug in the CAM XMl parser, currently &'s have to be embedded within sms calls as '#'
  // sends mms
 void mms(string phoneNum, string subject, string body, string mimetype,
 string attachment, string continuation); 
 
 // makes mms
 void make_mms(string phoneNum, string subject); 
 
 // attaches text to existing mms
 void attach_text_mms(string text); 
 
 // attaches file to existing mms
 void attach_mms(string mimetype, string attachment); 
 
 // sends existing mms
 void send_mms(string continuation); 


Utilities

 // returns current time formatted as 25/07/2006 15:03:57
 string timestamp();
 
 // returns info about nearest cell tower
 string location();
 
 // makes phone call
 void call(string phoneNum);
 
 // opens web browser
 void opera(string URL);
 
 // opens web browser
 void doris(string URL);
 
 // opens web browser
 void wap(string URL);
 
 // writes string to log file on phone (C:\Logs\CamBrowser\CamBrowser.log)
 void log();
 


FAQ

What phones does CAMBrowser work on?

CAM currently works only on Nokia 6600 model phones. We are working on porting CAM to more phones and platforms.

Where should I install CAM applications?

On the Nokia 6600, install on the Memory Card.

Where is CAM application data stored?

Absolute filenames (starting with \\) are interpreted relative to the memory card base directory (E:) Relative filenames are interpreted relative to the application working directory (E:\\system\\apps\\CamBrowser\\schemas\\formid_X\\).

How do I see the log files?

To be able to see CAM's log you have to install a Symbian app called FExplorer on the phone (http://www.gosymbian.com/FE_download.html)

This allows you to browse the phone's directory structure. The app-specific logs are stored in a directory called C:\Logs\CamBrowser. If any of these folders do not exist, you need to create them.

What documentation is available for CAM?

This README is the CAM documentation. Further documentation about the Simkin programming language and syntax can be found at [1]


How can I generate barcodes on my computer?

1) Setting things up

  • FOR MAC:

To do that, we need a local compile of php with some addnl libraries. If you dont have that already on your mac, this link will step you through most of it.

http://developer.apple.com/internet/opensource/php.html

On top of the directions there, you also have to make sure that you install gmp with something like 'fink install gmp'.

For example, this is the config command I used on my Mac (you may have some differences based on where you have mysql, postgres, apache, etc. installed.

  ./configure  --with-zlib-dir=/usr/local --with-jpeg-dir=/sw \
  --with-libtiff=/sw --with-png-dir=/sw --with-gd --enable-gd-native-ttf \
  --with-mysql=/usr/local/mysql \
  --with-xml=/sw -with-dom=/sw --with-apxs=/usr/sbin/apxs  \
  --with-gmp=/sw
  • FOR PC:

1) If you're using php only for development there's a great package called xampp that gets your PC ready in minutes.

http://www.apachefriends.org/en/xampp.html

2) Once you've installed everything, you will need to modify a configuration file for the code generator to work correctly. Open up C:\xampp\apache\bin\php.ini and search for the line "extension=php_gmp.dll" and uncomment it out (remove the semicolon at the front of the line).

3) After making the above change to the config file, restart your server.

4) Running codegen

From your CAM starter kit, find the codegen folder. Open and run code_compiler.html from your webbrowser (in a location that php will recognize - e.g. http://localhost/codegen/code_compiler.html ).

How can I do loops in CAM??

Here is a way to do loops / arrays. It basically uses the @ operator in Simkin: http://www.simkin.co.uk/Docs/Simkin/Scope.html

Here's an example

   for i=0 to 10 
   {
   myvar = "intval" # i;
   input_int(myvar, "Enter Int", "", "");
   log("data =" # @myvar);
   }

SOFTWARE

NOTE I haven't uploaded these yet

* Barcode generation software
* Demo CAMForm
* makesis: to compile Simkin code