[prev in list] [next in list] [prev in thread] [next in thread]
List: nsbasic-palm
Subject: [nsbasic-palm] Re: serial number of the device
From: "uuyan" <uuyan () yahoo ! com>
Date: 2001-12-29 12:06:49
Message-ID: a0kbkp+gqf2 () eGroups ! com
[Download RAW message or body]
Hi ,
i think this happened bec. m125 doesnt have a flash rom.... i'll try
to fix the program...
thanx for the answers
--- In nsbasic-palm@y..., George Henne <gh@n...> wrote:
> You didn't mention what happens when this doesn't work, but not all
> devices have serial numbers.
>
> >Hi 2 all ,
> >
> >I have used the code below. it worked fine with m505 , Vx ,
> >Handspring Prism , m100 but didnt worked with m125 and IIIc.
> >
> >Anyone have an idea about the problem...?????
> >
> >Thanx
> >
> >
> >
> >--- In nsbasic-palm@y..., "Adrian Nicolaiev" <nicolaiev@u...>
wrote:
> >> Hi,
> >>
> >> From Palm SDK Documentation:
> >> "Some Palm devices, beginning with the Palm III product, hold a
12-
> >digit
> >> serial number that identifies the device uniquely. (Earlier
devices
> >do not
> >> have this identifier.) The serial number is held in a
displayable
> >text
> >> buffer with no null terminator. The user can view the serial
number
> >in the
> >> Application Launcher application. (The pop-up version of the
> >Launcher does
> >> not display the serial number.) The Application Launcher also
> >displays to
> >> the user a checksum digit that you can use to validate user
entry
> >of the
> >> serial number.
> >> To retrieve the ROM serial number programmatically, pass the
> >sysROMTokenSnum
> >> selector to the SysGetROMToken function. If the SysGetROMToken
> >function
> >> returns an error, or if the returned pointer to the buffer is
NULL,
> >or if
> >> the first byte of the text buffer is 0xFF, then no serial number
is
> >> available."
> >>
> >> So, try:
> >>
> >> Dim RetVal as String
> >> Dim cardNo as Short
> >> Dim tokenStr as String 'This is the sysROMTokenSnum in string
format
> >> Dim dataP as String
> >> Dim sizeP as String
> >> Dim tokenInt as Integer 'This is the sysROMTokenSnum in integer
> >format
> >> cardNo = 0
> >> tokenStr = "snum" 'Token is defined as "snum" in Palm
> >Documentation...
> >> 'Convert sysROMTokenSnum string to 32-bit integer
> >> tokenInt = Asc(mid(tokenStr,1,1)) * 256 * 256 * 256
> >> tokenInt = tokenInt + ( Asc(mid(tokenStr,2,1)) * 256 * 256 )
> >> tokenInt = tokenInt + ( Asc(mid(tokenStr,3,1)) * 256 )
> >> tokenInt = tokenInt + ( Asc(mid(tokenStr,4,1)) )
> >> dataP = "XXXX" 'This is used to calculate checksum
> >> sizeP = &h5 'This is used to calculate checksum
> >> 'SysGetROMToken
> >> RetVal = SysTrapFunc(832,4,cardNo,tokenInt,dataP,sizeP)
> >> MsgBox "ROM Serial is " + mid(RetVal,1,12) 'RetVal is a 12 digit-
> >value without null terminator...
> >>
> >> HTH,
> >>
> >> Adrian Nicolaiev
> >> PS.: Remember... Usually, your POSE doesn't use a ROM with
Serial
> >Number
> >> (only if you have uploaded your device ROM to POSE). So, test in
> >your device
> >> or upload its ROM to POSE...While this works on Palm devices,
> >Handspring
> >> devices have an internal serial number. Therefore, all you get
back
> >is a
> >> blank value..
> >>
> >>
> >> > Is it possible to write codes in NS Basic to obtain
> >> > the serial code of the Palm during runtime?
> >> >
> >> > e.g. my Palm serial code is 10BK1581A7B5
> >> > I want the program written in NS Basic able to
> >> > get this code as, say, a string.
> >>
> >>
> >>
> >> [Non-text portions of this message have been removed]
>
>
> George Henne
> NS BASIC Corporation
> http://www.nsbasic.com
Community email addresses:
Post message: nsbasic-palm@yahoogroups.com
Subscribe: nsbasic-palm-subscribe@yahoogroups.com
Unsubscribe: nsbasic-palm-unsubscribe@yahoogroups.com
List owner: nsbasic-palm-owner@yahoogroups.com
Shortcut URL to this page:
http://groups.yahoo.com/group/nsbasic-palm
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic