#include <winsock2.h>
#include <bthdef.h>
#include <Ws2bth.h>
#include <Bthsdpdef.h>
#include <BluetoothAPIs.h>
#include <string.h>
#include <malloc.h>
#include <stdio.h>
#include <tchar.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
int | asciiToUnicode (char *string, int length, wchar_t *outString, int size) |
Ascii to unicode string conversion function. | |
int | authenticate (char *address, char *pinInput, BLUETOOTH_DEVICE_INFO *deviceInfo, int xml) |
Authenticates device. | |
int | checkForWinSock () |
Check for WinSock and Initialize it. | |
char * | findDevice (BLUETOOTH_DEVICE_INFO *bdi, char *address) |
Finds Bluetooth Device. | |
ULONGLONG | htoi (char *string) |
Converts Hex string to int. | |
int | removeAuthentication (char *address) |
removes authentication | |
char * | removeNonprintableChars (WCHAR *Input, SIZE_T Length) |
Remove non printable characters from unicode string. | |
BLUETOOTH_ADDRESS | stringToAddress (char *address) |
Turns nullterminated string to BLUETOOTH_ADDRESS. | |
void | takeOffStrangeMarks (char *string, int max) |
Takes off strange marks from string. | |
int | utf8ToUnicode (char *string, int length, wchar_t *outString, int size) |
UTF-8 to unicode string conversion function. |
int asciiToUnicode | ( | char * | string, | |
int | length, | |||
wchar_t * | outString, | |||
int | size | |||
) |
Ascii to unicode string conversion function.
Take ascii string and convert it into unicode string
string | char*, Pointer to the string to convert | |
length | int, Length of the string to convert | |
outString | wchar_t*, Pointer to the string receiving the converted string | |
size | int, Size of the outString in bytes |
int authenticate | ( | char * | address, | |
char * | pinInput, | |||
BLUETOOTH_DEVICE_INFO * | deviceInfo, | |||
int | xml | |||
) |
Authenticates device.
Tries to authenticate device, if already authenticated this does nothing. If pinInput is Null tries to authenticate with most common pin codes: 0000, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1234 If pinInput is not null tries to authenticate with that one.
address | Address to device | |
pinInput | null terminated string as Pin Code | |
deviceInfo | Bluetooth device info | |
xml | tells that xml print wanted |
int checkForWinSock | ( | ) |
Check for WinSock and Initialize it.
This function checks for WinSock 2.0 and Initializes it.
char* findDevice | ( | BLUETOOTH_DEVICE_INFO * | bdi, | |
char * | address | |||
) |
Finds Bluetooth Device.
Tries to find device by Bluetooth Device Name or by address
bdi | BLUETOOTH_DEVICE_INFO* | |
address | char*, null terminated string, Can be either address or name |
ULONGLONG htoi | ( | char * | string | ) |
Converts Hex string to int.
Converts null terminated string to Int
string | char * |
int removeAuthentication | ( | char * | address | ) |
removes authentication
Tries to remove authentication from device using device address
address | char*, Address to device |
char* removeNonprintableChars | ( | WCHAR * | Input, | |
SIZE_T | Length | |||
) |
Remove non printable characters from unicode string.
Take unicode string and remove non printable characters
Input | WCHAR*, Unicode string | |
Length | SIZE_T, integer value of maxium size of string |
BLUETOOTH_ADDRESS stringToAddress | ( | char * | address | ) |
Turns nullterminated string to BLUETOOTH_ADDRESS.
Changes nullterminated string to Bluetooth Address
address | char * |
void takeOffStrangeMarks | ( | char * | string, | |
int | max | |||
) |
Takes off strange marks from string.
Take ascii string and remove strange marks from it.
string | char*, looking for string | |
max | int, value of maxium size of string |
int utf8ToUnicode | ( | char * | string, | |
int | length, | |||
wchar_t * | outString, | |||
int | size | |||
) |
UTF-8 to unicode string conversion function.
Take UTF-8 encoded string and convert it into unicode string
string | char*, Pointer to the string to convert | |
length | int, Length of the string to convert in characters | |
outString | wchar_t*, Pointer to the string receiving the converted string | |
size | int, Size of the outString in bytes |