On Sun, 27 Feb 2005, Linkas wrote:
I've encoded the URL too, and this is my text:
%01 // Transaction ID
%06 // Push
%04 // Lenght of headers
%03 // Lenght of content-type
%B0 // Content type is application/vnd.wap.slc
%81 // Charset is
%EA // UTF-8
%02 // WBXML version
%06 // Wap Push SL
%6A // This is still a mistery
%00 // Leght of string table is zero
%85 // Here it starts the SL tag
%08%03 // URL type is "" and Start of string
http%3A%2F%2Fwww.info-me.it%2Fwap%2Findex.wml // The encoded URL
%00 // End of string
%01 // end of the SL tag
the UDH is always the same:udh=%06%05%04%0B%84%23%F0
UDH will always be the same.
Text needs to have the binary encoded data you mention above.
Here's an example, without the percent signs
UDH: 0605040B8423F0
Text: 1B0601AE02056A0045C60C03736D732E6B6174617A6F2...17A6F2E000101
Some PHP:
$udh = '0605040B8423F0';
$text = '1B0601AE02056A0045C60C03'
.hex_encode($url, '')
.'000103'.
hex_encode($title, '').
'000101';
function hex_encode( $text, $joiner='' ) {
for ($l=0; $l<strlen($text); $l++) {
$letter = substr($text, $l, 1);
$ret .= sprintf("%s%02X", $joiner, ord($letter));
}
return $ret;
}
Make more sense? (yes, I know the hex_encode function could be written
better)
Beckman
---------------------------------------------------------------------------
Peter Beckman Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---------------------------------------------------------------------------