EDIT: A more easily read version of this quandary is up at StackOverflow. Read that one.
So I'm trying to make an application that determines your location via any means possible. In doing so, and in making my application as available to as many devices as possible, I'm reverse engineering popular location look-up services (mainly, google maps and windows mobile live search).
Fortunately for me, the google maps lookup was already reverse engineered by a guy on CodeProject. I am now working on the same for Live Search. This is what I've determined so far:
A HTTP request is made to:
mobile.search.live.com/positionlookupservice_1/service.aspx
with a user-agent string of:
Windows Live Mobile Local Search
An an expected response of:
100-Continue
Once the application is returned the 100, it sends a bunch of data. This is where it starts to get messy. Here is what I've found so far:
After the 20byte header, there is a 7 byte value. In what I captured, it is are:
0x00 0x00 0x00 0x01 0x00 0x00 0x00
After that, you get the following encoded value.
Hex values immediately before a text string are equal to the length of the string:
(0x05)UTF-8
(0x05)en-US
(0x05)en-US
(0x01)
(0x06)Device
(0x05)dummy
(0x01)
(0x06)
(0x02)PL
(0x08)
(0x0E)ReverseGeocode
(0x01)
(0x07)
(0x0B)GPSChipInfo
(0x01)(0x20) <-- I guess I don't have GPS enabled
(0x06)
(0x09)CellTower
(0x06)
(0x03)CGI
(0x08)
(0x03)MCC
(0xb6)(0x02) <-- according to cellcatcher, should be 310
(0x07)
(0x03)MNC
(0x03)410
(0x08)
(0x03)LAC
(0xCF)(0x36) <-- cell catcher says 6991
(0x08)
(0x02)CI
(0xFD)(0x01) <-- cell catcher says 259
(0x00)
(0x00)
(0x00)
(0x00)
Here's the response breakdown:
Following the header and HTTP headers:
0x00 0x00 0x00 0x01 0x00 0x00 0x00
(0x00)
(0x01)
(0x06)
(0x02)PL
(0x06)
(0x08)Locality
(0x06)
(0x08)Location
(0x07)
(0x03)Lat
(0x09)42.375621
(0x07)
(0x04)Long
(0x0A)-71.158938
(0x00)
(0x07)
(0x06)Radius
(0x09)2000.0000
(0x00)
(0x42) <-- Node B (thanks RiverRat!)
(0x07)
(0x0C)LocalityName
(0x09)Watertown
(0x07)
(0x16)AdministrativeAreaName
(0x0D)Massachusetts
(0x07)
(0x10)PostalCodeNumber
(0x05)02472
(0x07)
(0x0B)CountryName
(0x0D)United States
(0x00)
(0x00)
(0x00) <-- Bonus?
I think the data is being sent in a hash.
This is what I make of some of the prepended hex characters:
0x00 - Closing bracket
0x01 - Base level element terminator
0x06 - Opening bracket
0x07 - Field value is text
0x08 - Field value is encoded (anyone know how those values are encoded?)
There are a few things I still don't understand ...
1) Is there any significance to the 7 byte header?
2) What is the significance of the opening and bonus closing (0x00) in the response?
4) How are the values with type 0x08 encoded?
Attached are the raw packets also available here: http://www.copytaste.com/or1a15g0
According to the data you received...
You were connected to AT&T site 0025 (AKA
Mt Auburn Street Wine Shop)
Site is located at 818-826 MT AUBURN ST Watertown, MA
the 9 is related to the sector you were in
the sites true location is... -71.1506 42.3747 (These are the coordinates that the LMU has in it)
based on the LAC, you were connected to the 3G radio, a LAC of 6012 would have meant you were connected to the Nokia 2G Radio side.
check out this post:
http://forum.xda-developers.com/showthread.php?t=393189&page=17
lotion said:
3) Why the (0x42) in the response?
Click to expand...
Click to collapse
Node B is a term used in UMTS to denote the BTS
http://en.wikipedia.org/wiki/Node-B
Bump in case anyone can figure out how the type 0x08 values are encoded.
Related
Hi everybody
I tried to achieve a handle for readFile/writeFile operations using lineGetID.
The call to the function passed without errors. My problem is that the handle that I get is 0..., and I should make IO operations some how...
My code:
lRet := lineGetID( FLineHandle, 0, 0, LINECALLSELECT_LINE, PVarString, szClassType );
if lRet = 0 then
begin
FDevHandle := (LPHANDLE(PByte(PVarString) + PVarString^.dwStringOffset ))^;
// some more non relevant code which checks the validity of FDevHandle....
end;
The call to lineGetID is done after successful call to lineGetOpen. I test my application on i-mate jam with WM2003.
Thanks ahead
Kobi
I solved the problem
Hi everybody
For those who encounters the same problem as mine here is the solution that I finally found:
1. The Handle is NULL if we call the lineGetID using LINECALLSELECT_LINE. We should call lineGetID after getting into the LINECALLSTATE_CONNECTED state and use the LINECALLSTATE_CALL parameter. This information was found in the MSDN.
2. The lineGetID (as well as other line functions) doesn't report (I use TAPI 2.0 with WM-2003 on i-mate jam - the cellular line channel) the error LINEERR_STRUCTURETOOSMALL, so immediately after calling the lineGetID I added the following line (I use free pascal compiler):
if (Result = 0) and (PVarString^.dwTotalSize < PVarString^.dwNeededSize) then
Result := integer(LINEERR_STRUCTURETOOSMALL);
After this line comes the characteristic TAPI code which checks if either we should reallocate the previous block, or we can already use the data that call should have given to us.
Just after considering these 2 issues I got a vaild Handle...
Kobi
Hi Kobi,
I also having difficulties creating handle to write data on this TAPI Line, Can you please help me translate your code in VB.NET or C#, I am using VB and C# on developing application in WM2003.
Many thanks in Advance,
Eefendi
More complete code
Hi Eefendi
I neither know VB.NET nor C#, so it will be in Pascal, but I will add comments.
The code itself should be activated after you received the LINE_CALLSTATECONNECTED message/event (depends on the mechanism you selected when you called lineInitialize).
The CallHandle is a variable holds the handle of the call you want to achieve a handle to its stream (you achieve CallHandle, in incoming call for example, using LINE_CALLSTATEOFFERING message/event). The final result we want is stored in Handle. The line itself should be opened using "comm" or "comm/datamodem" class type.
var
VarSize,
Res : integer;
PVarString : LPVARSTRING;
szClassType : PWideChar = 'comm/datamodem';
// these variables definitions is equivalent to the following C code:
// int VarSize, Res;
// LPVARSTRING PVarString;
// TCHAR *szClassType = "comm/datamodem";
begin
VarSize := sizeof(VARSTRING);
Handle := 0;
repeat
GetMem( PVarString, VarSize ); // alloc VarSize bytes
PVarString^.TotalSize := VarSize;
Res := lineGetID( 0, 0, CallHandle, LINECALLSELECT_CALL, PVarString, szClassType );
if (Res = 0) and (PVarString^.TotalSize < PVarString^.NeededSize) then
Res := LINEERR_STRUCTURETOOSMALL;
if Res = LINEERR_STRUCTURETOOSMALL then
VarSize := PVarString^.NeededSize
else
if Res = 0 then // no error
Handle := LPHANDLE(PByte(PVarString) + PVarString^.dwStringOffset)^;
FreeMem( PVarString, PVarString^.TotalSize ); // free memory
until Res <> LINEERR_STRUCTURETOOSMALL; // finish the repeat until loop if this condition is TRUE
if (Handle <> 0) and (Handle <> INVALID_HANDLE_VALUE) then
//;use it as you wish....
end;
Some help to you for conversion:
1. PVarString^.TotalSize using C means PVarString->TotalSize
2. PByte using C means char*
3. type cast for example to PByte is done by PByte(...) while using C it is done by (PByte)...
4. Refering to a value which is referenced by the pointer P and storing it in variable X is done by "X := P^;". using C it is done by "X = *P;".
5. The operator <> means not equal. in C it is !=.
I hope it will be easy to you to translate it to C or any other language you want.
Good luck with your project.
Kobi
TAPI does seem to pop up a lot.
Have you looked at my code I posted a while back here ?
http://forum.xda-developers.com/viewtopic.php?t=18978
Hi Vangelderp and Kobi,
thanks for spending your time answering my questions and also thanks for the code provided. I use VB.Net 2003 on programming my pocket PC 2003, you guys provide me the code using pointer data type which is not supported in VB.net, so I am having trouble converting it. ( When I was learning C++, pointer is always make me confuse :roll: ). I wish you guys will be kind enough helping me convert it to VB.Net, just for small part to get Handle. :wink:
Mant Thanks in advance,
Eefendi
Hello Everyone
I hope this is not too trivial a question. I am new to eVC. I would like to know how to convert from data type LONG to data type CHAR OR STRING in eVC.
Long myLong=1134.67
In VB the conversion will simply be
myString=STR(myLong)
How can I achieve this in eVC++?
Also someone please recommend some good books on eVC++.
Thanks.
ajanaman
evc++ is just like vc++
which is just like c++ with mfc on top of it
to do simple type casts you do
x=(Type)y;
here are some links also included dynamic type casts
http://www.cplusplus.com/doc/tutorial/typecasting.html
http://www.torjo.com/win32gui/doc/window_casting.html
Hello gsmtexts!
First I would like to point out that in C++ LONG data type is a 4 byte signed integer (in your example you use a floating point value).
Second I assume that by converting you mean representing the number as a string of characters an not just letting the computer assume that the variable contains ASCII values instead of a number.
Here's how you do it:
C++ language doesn't have string data type instead you use an array of char.
Example:
Code:
char myStr[255]; //you have a string of up to 255 ASCII chars.
double myVal = 50.1234; //a double precision floating point value
_gcvt(myVal, 6, myStr); //convert the string
You could use one of the functions (you can search the MSDN site for more details): _gcvt, _ecvt, _fcvt, but there is a simpler way as well:
Code:
WCHAR myStr[255]; //win CE works with Unicode strings.
float myVal = 1.2345; //the value
swprintf(myStr, L"The value: %f", myVal); //creates a string: 'The value: 1.2345'
Finally if you are using MFC:
Code:
CString str;
float myVal = 1.2345;
str.Format(_T("The value: %f"), myVal);
As for books I can only recommend "Teach yourself C++", by Jesse Liberty, it got me started in C++ programming.
Good luck.
Dear levenum
many thanks - I have sratched my head for nearly a week and you gave me the solution just like that. _gcvt did it. u are a wonderful guru.
ajanaman
You are welcome gsmtexts!
But I am far from being a guru. I just like programming so I picked up a book or two and the ball started rolling. 8)
Anyway, since you chose to use _gcvt you should know that in order to use the string you get with windows API's like SetWindowText you will have to convert it to Unicode:
Code:
WCHAR uniBuffer[50]; //Unicode buffer
char myString[50]; //ASCII buffer
_gcvt(1.2345, 5, myString); //convert value to string
mbstowcs(uniBuffer, myString, 50); //convert ASCII string to Unicode
The standard c++ way would be:
double d=122.332;
std:stringstream oss;
oss << d;
std::string mystring=oss.str();
The standard c++ way would be:
double d=122.332;
std:stringstream oss;
oss << d;
std::string mystring=oss.str();
Anyone know how to pass a pointer to a struct in VB.NET that could help me out?
" pGPSPosition
Pointer to a GPS_POSITION structure. On return, this structure is filled with location data obtained by the GPS Intermediate Driver. The dwValidFields member of the GPS_POSITION instance specifies which fields of the instance are valid."
This is from a link on MS site: (http://msdn2.microsoft.com/en-us/library/bb202050.aspx)
So how do I do this in VB?
Looking for a little love here...
TIA,
WM6 SDK contains the sample with the complete wrapper around the GPS intermediate driver in the managed code
But one warning - on some devices (namely HTC Artemis) the serious bug in some version of code provided by Microsoft to Oem return an error when calling functions this API. Communication with a GPS via serial port is still more reliable for a commercial solutions...
Appreciate the response but do you have any source that I can use with VB? My biggest problem is actually retrieving any information from the GPS device using the "GPSGetPosition" function. (see other link - http://forum.xda-developers.com/showthread.php?p=1979418#post1979418)
"But one warning - on some devices (namely HTC Artemis) the serious bug in some version of code provided by Microsoft to Oem return an error when calling functions this API"
Could you be a little more specific?
TW,
Semi manual marshhalling of structure to pointer:
Dim pointerM As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(myStruct))
Marshal.StructureToPtr(myStruct, pointerM, False)
Marshal.FreeHGlobal(pnt)
Ad Artemis and another devices) GPS structure has invalid size from old platform builder and intermediate driver (GPS API) refuse it with error.
RStein,
As I was reading about it appeared that Marshaling was going to have to be used in some way since I'm pretty sure that the struct would need to be passed to the C function.
Which brings me to another Q since it appears your are savy at programing in C - how to convert the following C struct?
The struct appears to have a couple of arrays and a few other enums thats are passed to the function, how is that handled in VB?
DWORD GPSGetPosition(
HANDLE hGPSDevice,
GPS_POSITION *pGPSPosition,
DWORD dwMaximumAge,
DWORD dwFlags
);
typedef struct _GPS_POSITION {
DWORD dwVersion;
DWORD dwSize;
DWORD dwValidFields;
DWORD dwFlags;
SYSTEMTIME stUTCTime;
double dblLatitude;
double dblLongitude;
float flSpeed;
float flHeading;
double dblMagneticVariation;
float flAltitudeWRTSeaLevel;
float flAltitudeWRTEllipsoid;
GPS_FIX_QUALITY FixQuality;
GPS_FIX_TYPE FixType;
GPS_FIX_SELECTION SelectionType;
float flPositionDilutionOfPrecision;
float flHorizontalDilutionOfPrecision;
float flVerticalDilutionOfPrecision;
DWORD dwSatelliteCount;
DWORD rgdwSatellitesUsedPRNs[GPS_MAX_SATELLITES];
DWORD dwSatellitesInView;
DWORD rgdwSatellitesInViewPRNs[GPS_MAX_SATELLITES];
DWORD rgdwSatellitesInViewElevation[GPS_MAX_SATELLITES];
DWORD rgdwSatellitesInViewAzimuth[GPS_MAX_SATELLITES];
DWORD rgdwSatellitesInViewSignalToNoiseRatio[GPS_MAX_SATELLITES];
} GPS_POSITION, *PGPS_POSITION;
Click to expand...
Click to collapse
I had a suggestion to create a library from the C# SDK, how difficult would that be? Would it be easier than trying to convert to VB?
Can you help with that?
Thanks for any feedback...
Took me the whole damn night but.... Got it working like a charm
Why isn't there any touchscreen driver in freebsd i could use the protocol from..
I ended up writing it all.. Kernel driver for touchscreen and hardware control, make up a protocol for absolute-input device plus xorg input driver to make it all work there.
It was fun.. it's the first freebsd 8 and xorg input driver i've written..
Kernel driver detects double tab, hold (to right click) and swipes (8 directions)
Swipes left/right give me diverent workspaces, up/down i'll make it do scrolling.
Also i'm building gestures in the driver.. like a circle will rotate Xorg
Some running information;
Shift# uname -a
FreeBSD Shift.parawebs.nl 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009 [email protected]:/usr/obj/usr/src/sys/GENERIC i386
Shift# ls -l /dev/ts0
crw------- 1 root wheel 0, 42 Dec 10 14:10 /dev/ts0
Shift# sysctl -a | grep ts\.0
dev.ts.0.%desc: HTC Shift Touchscreen
dev.ts.0.%driver: ts
dev.ts.0.%location: handle=\_SB_.PCI0.SBRG.EC2_
dev.ts.0.%pnpinfo: _HID=PNP0CC0 _UID=0
dev.ts.0.%parent: acpi0
Shift# pciconf -lv
[email protected]:0:0:0: class=0x060000 card=0x10015567 chip=0x27a08086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = '955XM/945GM/PM/GMS/940GML Express Processor to DRAM Controller'
class = bridge
subclass = HOST-PCI
[email protected]:0:2:0: class=0x030000 card=0x10015567 chip=0x27a28086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Mobile 945GM/GU Express Integrated Graphics Controller'
class = display
subclass = VGA
[email protected]:0:2:1: class=0x038000 card=0x10015567 chip=0x27a68086 rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Mobile 945GM/GU Express Integrated Graphics Controller'
class = display
[email protected]:0:27:0: class=0x040300 card=0x10015567 chip=0x27d88086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) High Definition Audio'
class = multimedia
subclass = HDA
[email protected]:0:29:0: class=0x0c0300 card=0x10015567 chip=0x27c88086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) USB Universal Host Controller'
class = serial bus
subclass = USB
[email protected]:0:29:1: class=0x0c0300 card=0x10015567 chip=0x27c98086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) USB Universal Host Controller'
class = serial bus
subclass = USB
[email protected]:0:29:2: class=0x0c0300 card=0x10015567 chip=0x27ca8086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) USB Universal Host Controller'
class = serial bus
subclass = USB
[email protected]:0:29:7: class=0x0c0320 card=0x10015567 chip=0x27cc8086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) USB 2.0 Enhanced Host Controller'
class = serial bus
subclass = USB
[email protected]:0:30:0: class=0x060401 card=0x10015567 chip=0x24488086 rev=0xe2 hdr=0x01
vendor = 'Intel Corporation'
device = '82801 Family (ICH2/3/4/5/6/7/8/9-M) Hub Interface to PCI Bridge'
class = bridge
subclass = PCI-PCI
[email protected]:0:31:0: class=0x060100 card=0x10015567 chip=0x27b98086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801GBM (ICH7-M) LPC Interface Controller'
class = bridge
subclass = PCI-ISA
[email protected]:0:31:1: class=0x01018a card=0x10015567 chip=0x27df8086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) Ultra ATA Storage Controller'
class = mass storage
subclass = ATA
[email protected]:0:31:3: class=0x0c0500 card=0x10015567 chip=0x27da8086 rev=0x02 hdr=0x00
vendor = 'Intel Corporation'
device = '82801G (ICH7 Family) SMBus Controller'
class = serial bus
subclass = SMBus
[email protected]:1:6:0: class=0x080500 card=0x44332211 chip=0x47431947 rev=0x09 hdr=0x00
class = base peripheral
subclass = SD host controller
Shift# usbconfig list
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen1.1: <UHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen2.1: <UHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen3.1: <EHCI root HUB Intel> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen3.2: <USB 2.0 Camera Sonix Technology Co., Ltd.> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen0.2: <Fingerprint Sensor vendor 0x08ff> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen3.3: <product 0x005a vendor 0x0409> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
ugen3.4: <product 0x7720 vendor 0x0b95> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen2.2: <product 0x0001 vendor 0x0a12> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
Shift# kldstat
Id Refs Address Size Name
1 38 0xc0400000 b6dfe0 kernel
2 1 0xc0f6e000 1b7b4 snd_hda.ko
3 2 0xc0f8a000 567c0 sound.ko
4 1 0xc0fe1000 4340 ichsmb.ko
5 2 0xc0fe6000 2c8c smbus.ko
6 1 0xc0fe9000 3d80 ichwd.ko
7 1 0xc0fed000 6778 ng_ubt.ko
8 6 0xc0ff4000 d9f4 netgraph.ko
9 2 0xc1002000 df6c ng_hci.ko
10 4 0xc1010000 23a0 ng_bluetooth.ko
11 1 0xc1013000 2d60 ts.ko
12 1 0xc4cb9000 9000 i915.ko
13 1 0xc4cd0000 14000 drm.ko
14 1 0xc6597000 f000 ng_l2cap.ko
15 1 0xc65a8000 21000 ng_btsocket.ko
16 1 0xc65d3000 4000 ng_socket.ko
Touchscreen works perfect now.. after a bit of needed sleep i found out what i was doing wrong with the button mapping and fixed it.
I can now move stuff (windows), select stuff (make selection box), double-tap to double click and hold to right click
Swipes are registered in the kernel module but not yet sent to xorg (swipe screen to scroll / select workspace)
Bluetooth works;
Shift# hccontrol inquiry
Inquiry result, num_responses=1
Inquiry result #0
BD_ADDR: 00:21:09:d8:d1:2e
Page Scan Rep. Mode: 0x1
Page Scan Period Mode: 0x2
Page Scan Mode: 00
Class: 5a:02:0c
Clock offset: 0x170c
Inquiry complete. Status: No error [00]
G-Sensor: I will write a driver for it this weekend.
Fingerprint reader: I'll try and make this one too.
High resolution: Need to decompile some stuff to find out how to trigger it.
3G: will work on it in the weekend
WiFi: Can't seem to activate mine anymore.. i'm guessing a hardware defect
I'm keeping the touchscreen kernel module & driver in alpha status while cleaning it up and add a few more features.
If anyone FreeBSD lover wants to try this on his/her shift contact me for alpha the drivers.
Also if more ppl like to help making drivers for the shift.. you are welcome!
More updates will follow here when i get more stuff working
I'm ecstatic about this. Keep up the good work.
wouhou great news!
Hi,
do you plan to release your drivers ?
i m really interested
thanks a lot
That is really great work
Im not a *nix user , but I understand the beauty of what you are doing!
Great job!
hi do you have news ?
i m really interested
thanks
okay, this is really nice,
is there any possibility to port this to fedora or ubuntu?
i really like those distro's.
nevertheless i would like to look into your sources after you finish cleanup,
i'm cheering for you!
Forgot about this topic
Hi there,
Sorry i kinda forgot this topic.
My Shift is still running FreeBSD and it still runs fine.
I'll pack the drivers and upload them here for anyone to mess with.
Touchscreen kernel module
Here is the kernel module to create the /dev/ts0 device for userland to talk to.
There's also a simple control utility to change some button settings/timings in the module on the fly.
You need to move the ts folders to the kernel source tree in the right location.
/usr/src/sys/modules
and
/usr/src/sys/dev
then type
cd /usr/src/sys/modules/ts && make && make install && kldload ts
To compile the control utility type
gcc tscontrol.c -o tscontrol
ps. the swipe debug messages are still visible in this version.. you may want to change that in ts.c before you compile it
I'll upload the xorg input driver in a minute.
xorg driver for ts module
Here is the xorg input driver that talks to my kernel module via /dev/ts0.
Extract it and type
cd ParaTouch && make && make install
add it to your xorg.conf like this;
Code:
Section "InputDevice"
Identifier "TouchScreen"
Driver "void" # oops i forgot to rename the sceleton :(
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
Option "MinX" "15"
Option "MaxX" "2000"
Option "MinY" "110"
Option "MaxY" "1940"
Option "Device" "/dev/ts0"
EndSection
Calibrate with changing MinX -- MaxY.
(the forum only accepts zip archives so i had to zip the tar)
Wow amazing work. Had to join this silly forum just to download your code.
Has this been made available to the FreeBSD base? I think there are a lot of folks over there who would be quite interested.
segfault007 said:
Had to join this silly forum just to download your code.
Click to expand...
Click to collapse
Wow. Classy.
This "silly" forum was the only way for you to get that code.
But apparently that didn't register when you wrote your post.
*shakes head*
Very very nice!!!
I know this is kinda an old thread at this point but if you are still monitoring it, I was wondering if you knew/know if this driver will work with other touchscreens?
Reason I ask is I have a Samsung Q1 Ultra that I would love to load FBSD on, the only thing holding me back is no working touchscreen. I was intending to use it as a Media Remote locked on a web page that does the actual "work"
Right now I am using Linux on it but would MUCH MUCH prefer to use FBSD instead as I really prefer FBSD over linux
BSD for SurfacePro
Hi OS,
Do you know how this can be done for the Surface Pro? Using say... PC-BSD.
thanks,
Anan
Do want
I would be fascinated to see this running - BSD has always been my preference
Curious, I'm not familiar with the Shift, is it an android device?
Hi guys,
I'm trying to connect Lumia 920 to the Linux (actually, to the RaspBian Linux, running on the Raspberry Pi).
I've correctly installed bluetooth on RPi and successfully paired RPi with Lumia. I've took sources of the simple RFCOMM server (actualy, I don't need more - just some simple text exchange) from http://people.csail.mit.edu/albert/bluez-intro/
For WP8 I've used (slight modified) sources from http://developer.nokia.com/Communit...nces_via_Bluetooth_and_NFC_on_Windows_Phone_8
On the client (WP8) side, the function await socket.ConnectAsync(rpiHostName,"1"); working correctly and returns no error (and RPi status in the bluetooth settings is "Connected"). Also, I can send strings (bytes) to the socket without errors. But on the server side (http://people.csail.mit.edu/albert/bluez-intro/x502.html#rfcomm-server.c), execution get stuck at:
Code:
// accept one connection
client = accept(s, (struct sockaddr *)&rem_addr, &opt);
Do you have any ideas/working samples?
Thanks!
I'd make some examples if I had a Raspberry Pi. This is pretty awesome that you're able to do this... Imagine the possibilities.
snickler, the RPi is really cheap; it costs just $40 from Amazon with free shipping. And device is ready to go: you just need a sd-card, and any cell phone power adaptor, that's all!
You may plug an USB hub, WiFi/BT dongles, keyboard, mouse or a webcam. Or connect it to TV by HDMI cable and use as media player (it can drive full HD video).
He-he, and it's open source; no (stupid) restrictions as on WP
P.S. I'm trying to build a small home robot to entertain my little princess (no, I'm lying actually: I entertain myself in the first place ).
Well, if you posted more code, I'm sure we could help you. However, it's pretty hard to do so when we have no idea how it works .
Sunius1 said:
Well, if you posted more code, I'm sure we could help you. However, it's pretty hard to do so when we have no idea how it works .
Click to expand...
Click to collapse
Sure, of course! https://www.dropbox.com/s/4fyp7nxgvlgkamb/bt.zip
Linux folder contains very simple linux socket server. IP part is working fine but not a BT. You may comment all RPi related stuff (currently I'm awaiting for the motor shield so the wiringPi commands just turn switching light diodes connected to GPIO ) and run server on the regular Linux box.
WP8 folder contains simple WP8 app (also working via IP or BT). IP part is working just fine (currently no advanced error handling implemented but it's OK for proto) but I can't communicate with Linux via BT
I've checked the code. Everything looks fine except the bind part on the server:
Code:
bind_return = ::bind ( m_sock, ( struct sockaddr * ) &m_addrBt, sizeof ( [b]m_addrIp[/b] ) );
Also, I couldn't find the documentation for it, so I'm not sure you're using bdaddr_t correctly.
Other than that, make sure nothing is listening to that port on the RaspberryPi - since the phone reports it connected successfully - it might have connected to some other application.
Yes, you right. It's mistyping, my fault (the sizes are different). Thanks! Can't try now, still working at office...
Sunius1, could you try this code on Linux (with correction)? And could you share yours (correct, I hope so ) /etc/bluetooth/* configuration files (I mean, what I should have in /etc/bluetooth/ to get this code working). I'm not a "Linux guy" unfortunately...
BTW, could you please provide any (even very simple) code to communicate between WP8 and Linux via Bluetooth (RFCOMM, L2CAP, etc.)?
Tried with code correction (proper structure size); unfortunately it doesn't helps MS tutorials are full of "how to connect windows phone to windows phone". Can't find anything about WP and Linux
Yeees! I've solved it!
The issue is solved by choosing port 5! I've run the sdptool on the RPi (output bellow) and discover that channels 1-4 are used by the damn WP... And (that is ridiculous!) nobody (yeah, that's right - MSFT's, damn "experts") at the MS or Nokia's forums never mentioned that!
So, I've changed the RF channel from "1" (this - damn f&*%ng lammahs! - mentioned at all (but very rare!) examples) to "5" and get strong and reliable connection!
Anybody, feel free to use posted (above, a few posts up) code; probably later I'll post whole projects (for WP & RPi Linux) on codeplex or github.
Code:
[email protected] ~/hobo/socket $ sdptool browse 54:79:75:C9:13:FA
Browsing 54:79:75:C9:13:FA ...
Service Name: Service Discovery
Service Description: Publishes services to remote devices
Service Provider: Microsoft
Service RecHandle: 0x0
Service Class ID List:
"SDP Server" (0x1000)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 1
"SDP" (0x0001)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Service Name: Device ID Service Record
Service Description: Device ID Service Record
Service RecHandle: 0x10000
Service Class ID List:
"PnP Information" (0x1200)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 1
"SDP" (0x0001)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Service Name: Object Push Profile
Service RecHandle: 0x10001
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100
Service Name: Microsoft Windows Audio Source
Service RecHandle: 0x10002
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x102
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0102
Service Name: Voice Gateway
Service RecHandle: 0x10003
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0105
Service Name: Phone Book Access PSE
Service RecHandle: 0x10004
Service Class ID List:
"Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3
"OBEX" (0x0008)
Profile Descriptor List:
"Phonebook Access" (0x1130)
Version: 0x0101
Service Name: BtSoftAp Service
Service RecHandle: 0x10005
Service Class ID List:
UUID 128: 232e51d8-91ff-4c24-ac0f-9ee055da30a5
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Profile Descriptor List:
"" (0x232e51d8-91ff-4c24-ac0f-9ee055da30a5)
Version: 0x0100
Service Name: Audio Video Remote Control Profile
Service RecHandle: 0x10006
Service Class ID List:
"AV Remote Target" (0x110c)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x103
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0104
Awesome! Glad you've solved it. I'm not running linux so I can't share those files, unfortunately. I just looked at the code from Windows .
Thanks, man! There are a few more small issues (4 example, when you trying to reconnect to the already connected device, the ConnectAsync method fails - looks like a MS "experts" never tested that issue - and, AFAIK there is no API to solve it ) but it's OK I've got my motor shield today and the next big task is to let my little "guy" to move free in the house
Did you look at Winsock API? It's huge, it can achieve much more things than you can do through regular C# sockets. AND it's wholly available on Windows Phone 8.
Thanks for suggestion but my current solution with StreamSocket (yes, I know it lacks a lot of features) satisfy my needs on 99.9%
I don't need something more sophisticated: my goal is to use WP as a "robot remote control", to manually controlling the chassis and choose and run HoBo's programs (coming soon).