Rex Software Development
                          

This document is a companion to the translation of the DS2 SDK manual. There are many API calls that are supported by the Rex firmware that are not documented in that manual. There are also a number of constants defined in header files that are not explained or listed in the main manual.

Not every aspect has been explicitly tested and verified. If you discover any area that appears in error please advice via www.rexextras.net.

Myles Rix      September 2001

 
 

1.   Contents

1.      Contents. 1

2.      Extra functions in Syscalls.h.. 1

2.1.1       DsTime24Get(  ) 1

2.1.2       DsTime24Set( mode  ) 1

2.1.3       DsTimeFormatGet( ) 2

2.1.4       DsTimeFormatSet( mode  ) 2

2.1.5       DsDialogCheckBoxSet( eventid, mode) 2

2.1.6       DsDialogComponentDraw( x, y, MSG_ID, comp# ) 3

2.1.7       Unimplemented functions. 4

3.      Extra functions in SyscallEx.h.. 5

3.1.1       DsCalStrFTime. 5

4.      Extra functions in Rex DLLs. 6

4.1.1       LIBRARY     REX.DLL. 6

4.1.2       LIBRARY REXDB.DLL. 7

4.1.3       LIBRARY REXTOOL.DLL. 8

 

 

2.   Extra functions in Syscalls.h

 

2.1.1              DsTimeGet(DATE* date, TIME* time  )


typedef struct {

unsigned int year;

unsigned char month;

unsigned char day;

unsigned char week;

} DATE;


typedef struct {

unsigned char hour;

unsigned char minute;

unsigned char second;

} TIME;

 

DsTimeSet( arg1, arg2  )

DsLocalTimeGet( arg1, arg2, arg3  )

2.1.2              DsTime24Get(  )

Int DsTime24Get()

Returns the user setting from the controls section for the time format either:

0:       12 hour

1:       24 hour

 

2.1.3              DsTime24Set( mode  )

Sets time, for example

arg1  = DsTime24Get

DsTime24Set( short? arg1 )

Mode is:

0       12 hour

1       24 hour

 

DsTimeSummerGet( arg1  )

DsTimeSummerSet( arg1, arg2   )

DsMonthPeriodGet( arg1  )

DsHomeCityGet( )

DsHomeCitySet( arg1  )

2.1.4              DsTimeFormatGet( )

Obtains current time format settings, see TimeFormatSet below

2.1.5              DsTimeFormatSet( mode  )

Mode is 

0       MM/DD/YYYY

1       DD/MM/YYYY

2       DD MMM YYYY

others are untested

 

DsTravelTimeGet( arg1, arg2  )

DsTravelTimeSet( arg1, arg2  )

DsTravelCityGet( )

DsTravelCitySet( arg1  )

DsAlarmTimeGet( arg1  )

DsAlarmTimeSet( arg1  )

DsAlarmEnable( arg1  )

DsAlarmSet( arg1  )

DsBeepSet( arg1  )

DsReadLastMessage( arg1  )

DsAddinExecute( arg1  )

DsDisplayComponent( arg1, arg2, arg3  )

DsSetScrollSize( arg1  )

DsDisplayCircle( )

DsDisplayBlockStore( arg1, arg2, arg3, arg4, arg5  )

DsDisplayBlockRestore( arg1, arg2  )

DsDisplayImageDrawOr( )

DsTextOut( arg1, arg2, arg3, arg4, arg5  )

DsDialogEditShow( arg1  )

DsDialogEventSet( arg1, arg2, arg3, arg4, arg5  )

DsDialogEventDraw( arg1, arg2, arg3, arg4  )

2.1.6              DsDialogCheckBoxSet( eventid, mode)

Certain component ID's can be used to draw checkboxes (or checkbox-like) buttons: 45h, 46h, 62h, 63h, 64h, 65h and 66h.
After this, the DialogCheckBoxSet function can be called.

Syntax:
Mode can be a value from 0 to 3, 0 = cleared, 1 = set, 2 =?,3 = ?.

Event_id must be the same as the event_id used in DialogComponentDraw.

Return values: 1 on success, any other value indicates an error.

Note:
When the event_id refers to a component other than the ones mentioned above or to an event_id used to define an area
(eg. EventAdd()), the entire area is drawn as an open box, a filled box, a rounded box, or just left empty. As you'll see
from the "open box" it looks more like an empty bucket, and it appears this situation is littered with bugs. Also note problems if when re-using event_id's that were previously used for this purpose, even after an EventClear().

 

DsDialogCheckBoxDraw( arg1, arg2, arg3, arg4  )

2.1.7              DsDialogComponentDraw( x, y, MSG_ID, comp# )

comp#           description

64   big lock

65   memory chip

66   rex (?) with a hand typing with one finger

67   torso with head (like a board game piece)

68   circle with "i" inside

69   small square with a shadow

70   empty circle          

71   thin vertical bar with the text "Edit" to the right of it

72   an eye with the text "Today" to the right

73   the text "Day"

74   the text "Month"

75   the text "Week"

76   the text "Cancel"

77   a little keyboard with the text "Key"

78   empty dashed square with the text "Uncheck"

79   upward pointing small triangle

80   downward pointing small triangle

81   left pointing small triangle

82   right pointing small triangle

83   exclamation mark with text "Priority"

84   sort of calendar sheet with text "Due Date"

85   exclamation mark

86   sort of calendar sheet

87   ?? 8 tiny triangles in 2 rows with the lower right one 'radiating'

88   ?? sort of very simple keyboard or so

89   more rectangular circle with and "i" inside

90   sort of handwritten cross mark

91   upward pointer turning to the left

92   bell

93   small open lock

94   folder symbol

95   up and downward pointing arrows with text "Company"

96   up and downward pointing arrows with text "First Name"

97   folder symbol with text "Category"

98   'inverted' arrow pointing downward

99   left arrow (bigger)

100 right arrow (bigger)

101 left arrow (smaller)

102 right arrow (bigger)

 

DsResourceGet( arg1  )

DsIconDraw( arg1, arg2, arg3, arg4  )

DsIconMove( arg1, arg2, arg3, arg4  )

DsPowerIdleModeEntry( )

DsPowerStopModeEntry( )

DsPowerModeGet( )

DsPowerModeSet( )

DsPowerBatteryInfoGet( )

DsPowerLineCheck( )

DsPowerOffTimeSet( arg1  )

DsPowerHaltEnable( )

DsKeyCodeGet( )

DsKeyRepeatSet( arg1  )

DsKeyClickSet( arg1  )

DsSoftKeyClose( )

DsTouchCalibration( arg1  )

DsTouchClickSet( arg1  )

DsTouchDataGet( arg1  )

DsJStrCmp( arg1, arg2, arg3, arg4, arg5  )

DsMalloc( arg1  )

DsRealloc( arg1, arg2  )

DsFree( arg1  )

DsAddinPrevGet( )

DsAddinPrevSet( arg1  )

DsDbTextOp( )

2.1.8              Unimplemented functions

The following firmware functions are not implemented and a call to these will cause a firmware reset.

DsFepExecute( )

DsIConReverse( arg1  )

DsResourceChange( arg1  )

DsShellRefreshTopMode( )

DsProgramTerminate( arg1  )

DsProgramExecute( arg1  )

DsEventStatusGet( arg1  )

DsEventPriorityGet( )

 

 

3.   Extra functions in SyscallEx.h

DsTextOut24( arg1, arg2, arg3, arg4, arg5 )

DsTextOut24A( arg1, arg2, arg3, arg4, arg5 )

DsTextWidth( arg1 )

IsZenkaku( arg1 )

DsStrCpy( arg1, arg2 )

DsStrCpyA( arg1, arg2 )

DsMemCpy( arg1, arg2, arg3 ) \

DsMemCpyA( arg1, arg2, arg3 ) \

DsCalDateTime( arg1 )

DsCalTimeDate( arg1, arg2 )

DsCalDayOfWeekD( arg1 )

3.1.1              DsCalDayOfWeek( arg1 )

Type integer DsCalStrFTime(CDATE *date)

Returns the day of the week 0= Sunday, 1= Mondayc..6=Saturday

3.1.2              Calendar data structures

typedef struct CDATE {

   char   day;

   char   month;

   short  year;

} CDATE;

 

typedef struct CTIME {

   char   minute;

   char   hour;

} CTIME;

3.1.3              DsCalStrFTime

DsCalStrFTime(CDATE *date, CTIME *time, format-string, result string, mode)

Converts a date and time into a formatted text string of a user selected format.

Arguments

mode = 0  from a DS2 addin - no idea what it does

Format string values:

%D /                                                            %d          1/2 digit day of month

%E three letter weekday                             %e          full name of the weekday

%G three letter weekday                             %g          /

%H 2 digit hour (24  hours)         %h          1/2 digit hour (24 hours)

%I   2 digit hour (12 hours)                          %i           1/2 digit hour (12 hours)

%M minutes?                                              %m         minutes?

%P /                                                            %p          PM/AM

%T full name of the month          %t           3 letter month

%W               2 digit week of year                              %w          3 letter weekday

%Y 4 digit year                                            %y          /

 

DsCalStrFTime24( arg1, arg2, arg3, arg4, arg5 ) \

DsCalStrFTime24A( arg1, arg2, arg3, arg4, arg5 ) \

3.1.4              DsCalDayAdd(CDATE *date, SHORT days )

Adds the number of days specifed by the second parameter to the date supplied.

Note that this days can be a negative number – ie you can also subtract days.

 

DsCalDateToStr( arg1, arg2, arg3 ) \

DsCalMonthAdd( arg1, arg2 )

DsCalMaxDayOfMonth( arg1 )

3.1.5              DsCalNthXdayInMonth( arg1, arg2, N, X)

N = occurance of weekday X in the month

Arg2 is the returned date

Arg1 is the input date?

 

DsCalIntToStr( arg1, arg2, arg3, arg4 ) \

DsCalDayToStr( arg1, arg2 )

DsCalDayToStrE( arg1, arg2 ) \

DsCalWeekOfYear( arg1, arg2 ) \

DsCalMinuteAdd( arg1, arg2, arg3 ) \

DsSynchronize(  )

DsSetupInfoSet(  )

DsPasswdEnable( arg1 )

DsPasswdSet( arg1 )

DsPasswdGet( arg1 )

DsUserInfoGet( arg1, arg2, arg3, arg4 ) \

DsAlarmUpdate(  )

DsFlashWriteStart(  ) \

DsFlashWriteEnd(  ) \

DsSystemErrorSet( arg1, arg2, arg3 ) \

DsSystemErrorGet( arg1, arg2 ) \

DsShortcutMask( arg1 ) \

DsPowerOffCountClear()

DsSoftwareKeyboardWithYomi( arg1, arg2, arg3 )

DsDialogWindow( arg1, arg2, arg3, arg4 )

DsDisplayTab( arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 )

 

4.   Extra functions in Rex DLLs

The rex DLL's appear to export some very interesting functions, though parameters are unknown.

4.1.1              LIBRARY     REX.DLL

DSBEEnd

DSBEStart

DSChangeTimeOut

DSClose

DSFLErase

DSFLRead 

DSFLWrite 

DSGetBaudRate

DSGetTimeOut

DSGetTimeOutDefault

DSOpen

DSPOBEEnd

DSPOBEStart

DSPOGetPort

DSREGetRate

DSREGetTimeOut

DSRESetPort

DSRESetRate

DSRESetTimeOut

DSSBGetStruct

DSSODelete

DSSOFormat   

DSSOGarbage

DSSORead

DSSOWrite

DSSetBaudRate

DSSetCommunicationCallback

DSSetFileHandle

DSSetTimeOut

DSTMRead

DSTMWrite

DSUFFirmware

DSUFFirmwareUpdateNotConnect

DSUIGetPort

DSVRGetDataSlim

DSVRGetDll     

DSWakeupCradle

 

4.1.2              LIBRARY REXDB.DLL

DbAbortSession

DbCleanup

DbClose       

DbCloseSession         

DbCommClose           

DbCommOpen           

DbCommSetPort        

DbCopyField

DbCopyFields             

DbCreate     

DbCreateIndex            

DbDeleteIndex            

DbDeleteRecord         

DbDeleteText              

DbDestroy   

DbEmuLoad

DbEmuWait 

DbFindFirstRecord     

DbFindRecord            

DbFlush       

DbFreeInfo   

DbGetDiskInfo             

DbGetError  

DbGetFieldSize           

DbGetInfo     

DbGetRecordCount    

DbInitialize   

DbInsertRecord          

DbInsertText

DbNextRecord            

DbOpen       

DbOpenSession         

DbPreviousRecord     

DbReadField

DbReadRawRecord   

DbReadRecord           

DbReadText

DbSetDataFile            

DbSetFullCaching       

DbSetStandalone        

DbShowProgress       

DbShowTree               

DbUpdateField            

DbUpdateRecord        

      

4.1.3              LIBRARY        REXTOOL.DLL

DSADCreateTable      

DSADDelete

DSADDeleteAll            

DSADDeleteID            

DSADGet     

DSADGetID 

DSADInsert  

DSADIsFile  

DSADRegularize        

DSDBCreateTable      

DSDBDICreateDeviceUniqueId 

DSDBDICreateTable  

DSDBDIGetDatabase 

DSDBDIPutDatabase 

DSDBDeleteRecordAll               

DSDBDeleteTable      

DSDBGetRecord        

DSDBInitialize             

DSDBInsertInitializeDirectory    

DSDBInsertRecord     

DSDBIsFileData         

DSDBIsFileTable        

DSDBIsTable              

DSDBListTableType   

DSDBPICreateTable  

DSDBPIDelete            

DSDBPIGet 

DSDBPIInsert             

DSDBSICreateTable  

DSDBSIInsertDefault  

DSDBWCCreateTable              

DSDBWCSetCityInfo  

DSMECreateTable      

DSMEDeleteAll           

DSMEDeleteCategory

DSMEDeleteTitle        

DSMEDeleteTitleID     

DSMEDeleteTitleIDList              

DSMEGetCategory     

DSMEGetTitle             

DSMEGetTitleID          

DSMEInsert 

DSMEInsertText          

DSMEIsFile  

DSMEIsFileText          

DSMEIsRead              

DSSHCreateFile         

DSSHCreateTable      

DSSHDeleteAddin      

DSSHFormat              

DSSHGetFile              

DSSHGetFlush           

DSSHGetInfoAddin     

DSSHGetInfoSizeAddin             

DSSHInsert  

DSSHIsFile  

DSTMSetTime