bt_servers:array[1..2] of String;
S:string;
x,y,x2,y2,temp:integer;
procedure servers_list(list: integer);
begin
Debug('servers:'+list);
bt.start(bt_servers[1]);
end;
procedure connection_error;
var
cm: command;
begin
showAlert('Bluetooth', 'Ошибка Bluetooth соединения.', loadImage('/icon.png'), ALERT_ERROR);
playAlertSound;
cm := createCommand('OK', CM_OK, 1);
repeat
delay(100);
until getClickedCommand <> emptyCommand;
end;
procedure message_received(msg:String);
begin
S:=msg;
end;
procedure accept_connection;
begin
bt.send_message('OK');//отправляем сообщение
end;
Begin
bt.init;
setcolor (0,0,0);
fillrect (0,0,240,320);
setcolor (0,255,0);
drawtext ('Выберите тип подключения, ',0,0);
drawtext ('нажав одну из кнопок:, ',0,25);
setcolor (32,125,64);
drawtext ('1 - сервер ',0,55);
drawtext ('3 - клиент ',0,80);
repaint;
//инструкция :)
repeat
delay (100);
Until ((GetKeyPressed=KE_KEY1) or (GetKeyPressed=KE_KEY3));//ждем, пока не нажата одна из клавиш
if GetKeyPressed=KE_KEY1 then bt.wait_connection('ME'); //если нажата кнопка 1 – мы сервер
if GetKeyPressed=KE_KEY3 then bt.search_connection; //если нажата кнопка 3 – мы клиент
setcolor (0,0,0);
fillrect(0,0,240,320);
setcolor (10,240,255);
drawtext('Ожидание связи...',0,0);
repaint;
repeat
delay(100);
until(S='OK');//тот самый “пустой” цикл. Ждем сообщения ‘OK’
setcolor (0,16,32);
fillrect(0,0,240,320);
setcolor (10,255,17);
drawtext('Готово!',0,0);//пишем о том, что соединение установлено!
Repaint;
delay(1000);
bt.send_message('текст, який потрібно відправити');
А ось програма власної розробки для переписки через Блютус.