⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bth_server_lib.h

📁 通过手机蓝牙控制个人电脑上的幻灯片的播放
💻 H
字号:
// BTH_Server_lib.h
#define MAX_LOADSTRING 100
#define BLUETOOTHQUERY_MAXDEVICES	32
#define MAX_LOADSTRING 100
#define BLUETOOTHQUERY_MAXDEVICES	32
#pragma once

using namespace System;

namespace BTH_Server_lib {

	public __nogc class BTH_Server_Conn{
		private:
			BTH_ADDR  deviceAddrList __nogc [BLUETOOTHQUERY_MAXDEVICES];
			TCHAR	 deviceNameList __nogc [BLUETOOTHQUERY_MAXDEVICES][64];
			int intDeviceCount;
			SOCKET sockBTH;
			SOCKET ClientSocket;
			SOCKADDR_BTH SockAddrBthLocal;

		public:
			BTH_Server_Conn(void);
			BTH_Server_Conn(const BTH_Server_Conn& tempBTH_Server_Conn);
			
			
			~BTH_Server_Conn();
			//void operator=(const BTH_Server_Conn& objBTH_Server);
			const char* toChar(const wchar_t* nString);
			//void ShowMessage(const char* nTitle, const char* nInfo, ...);
			//wchar_t ToWChar(const char*nInfo, ...);
			int toNativeBTHAddr(const WCHAR **pp, BTH_ADDR *pba);
			void convertCharToTCHAR(char *c, TCHAR* t);

			bool FindDevices(void);

			char* InitialiseWinsock(void);
			void TerminateWinsock(void);

			char* IsDeviceVaild(int intDeviceNum);

			char* InitialiseSocket(void);
			void TerminateSocket(void);

			char* RegisterBTHService(void);

			char* MakeConnection(int intDeviceNum);
			char* ListenMsg(void);
			char* AcceptMsg(void);
			char* RecieveMsg(void); /*char* can be changed*/
			char* SendMsg(char* strInput);

			char* CloseSocket(void);

			char* GetServerName(int intDeviceNum);
			int GetDeviceCount(void);

			SOCKADDR_BTH  GetLocalSocketAddress(void);
			void SetLocalSocketAddress(SOCKADDR_BTH temp);

			SOCKET GetClientSocket(void);
			void SetClientSocket(SOCKET tempClientSock);
	};
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -