OSM Mobile Binary Protocol/Types

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — OSM Mobile Binary Protocol/Types
· Afrikaans · Alemannisch · aragonés · asturianu · azərbaycanca · Bahasa Indonesia · Bahasa Melayu · Bân-lâm-gú · Basa Jawa · Baso Minangkabau · bosanski · brezhoneg · català · čeština · dansk · Deutsch · eesti · English · español · Esperanto · estremeñu · euskara · français · Frysk · Gaeilge · Gàidhlig · galego · Hausa · hrvatski · Igbo · interlingua · Interlingue · isiXhosa · isiZulu · íslenska · italiano · Kiswahili · Kreyòl ayisyen · kréyòl gwadloupéyen · Kurdî · latviešu · Lëtzebuergesch · lietuvių · magyar · Malagasy · Malti · Nederlands · Nedersaksies · norsk bokmål · norsk nynorsk · occitan · Oromoo · oʻzbekcha/ўзбекча · Plattdüütsch · polski · português · português do Brasil · română · shqip · slovenčina · slovenščina · Soomaaliga · suomi · svenska · Tiếng Việt · Türkçe · Vahcuengh · vèneto · Wolof · Yorùbá · Zazaki · српски / srpski · беларуская · български · қазақша · македонски · монгол · русский · тоҷикӣ · українська · Ελληνικά · Հայերեն · ქართული · नेपाली · मराठी · हिन्दी · অসমীয়া · বাংলা · ਪੰਜਾਬੀ · ગુજરાતી · ଓଡ଼ିଆ · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · සිංහල · ไทย · မြန်မာဘာသာ · ລາວ · ភាសាខ្មែរ · ⵜⴰⵎⴰⵣⵉⵖⵜ · አማርኛ · 한국어 · 日本語 · 中文(简体)‎ · 吴语 · 粵語 · 中文(繁體)‎ · ייִדיש · עברית · اردو · العربية · پښتو · سنڌي · فارسی · ދިވެހިބަސް

Table of allocated 8bit types for binary data transfer, strictly speaking most of these are not part of the protocol, but its useful to all use the same values for similar purposes, so feel free to add new ones your app is using if it is following the pattern of "{length} {8bit type as below} {data}".

Function Value Hex Reply
OSM Binary Header 0x05
Content Specifier # 0x23
Tile definition a 0x61
Blog upload b 0x62 0xe2
Map Correction upload c 0x63 0xe3
Blog download d 0x64 0xe4
Email e 0x65 0xe5
Failure f 0x66
GSM Cell upload g 0x67 0xe7
GSM Cell upload v2 h 0x68 0xe8
POI (node replacement 64bit id) i 0x69
POI Deleted j 0x6a
Free Block k 0x6b
Login Password l 0x6c 0xec
Machine Id m 0x6d
Node download (old 32bit) n 0x6e
Omitted Ways (v1 only) o 0x6f
Postcode upload p 0x70 0xf0
Relation r 0x72
Omitted Relations (v1 only) s 0x73
Updated Time t 0x74
Blog Url u 0x75 0xf5
Routeable Way download v 0x76
Way download w 0x77
GSM Cell location request x 0x78 0xf8
Way Deleted y 0x79
Relation Deleted z 0x7a

Data is transmitted as 32bit length in number of bytes followed by that much data where the first byte is a type from this list. Responses either to give a receiving side id code or to permit sender deletion on successful upload use the same code but with the top bit set.

Format definitions

OSM Binary Header

[block length=0x02 0x00 0x00 0x00] 0x05 0x3B

This is an optional 6 byte header at the beginning of an OSM Binary format file.

Postcode

[block length=5]0xf0[senders id of postcode item]

This just indicates that the post code was received and was ok (so sender can delete/mark as uploaded)

Map Correction

[block length=5]0xe3[senders id of map correction item]

This just indicates that the map correction was received and was ok (so sender can delete/mark as uploaded)

Content Specifier

[block length=2]0x23[either F for fresh content or C for cached content]

Failure

[block length]0x66[8 bit error code - allocated below][8 bit textlen (optional)][text (upto 255 chars) (optional)]

EDownloadErrorBlogUrl=1
EDownloadErrorEmail=2
EDownloadErrorLatLon=3
EDownloadErrorPostcode=4
EDownloadErrorTooBig=5
EDownloadErrorConnect=6
EDownloadErrorPerms=7
EDownloadErrorXMLError=8
EDownloadErrorNoData=9
EDownloadErrorServerProblem=10
EDownloadErrorLzmaProblem=11

This tells you what failed, and a user friendly message (if appropriate).