1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-20 21:01:25 +03:00

Bugfix and fix compilation erro with new-extensions branch

This commit is contained in:
mlafauci
2011-05-18 08:39:47 +02:00
parent 8d1761f009
commit 4f7e2f1201
12 changed files with 144 additions and 29 deletions

View File

@ -3,6 +3,7 @@ extern "C" {
#include "utility/wl_types.h"
#include "socket.h"
#include "string.h"
#include "utility/debug.h"
}
#include "WProgram.h"
@ -35,25 +36,28 @@ uint8_t Client::connect() {
void Client::write(uint8_t b) {
if (_sock != 255)
{
while (!ServerDrv::isDataSent(_sock));
START();
ServerDrv::sendData(_sock, &b, 1);
while (!ServerDrv::isDataSent(_sock));
END();
}
}
void Client::write(const char *str) {
if (_sock != 255)
{
while (!ServerDrv::isDataSent(_sock));
unsigned int len = strlen(str);
ServerDrv::sendData(_sock, (const uint8_t *)str, len);
while (!ServerDrv::isDataSent(_sock));
}
}
void Client::write(const uint8_t *buf, size_t size) {
if (_sock != 255)
{
while (!ServerDrv::isDataSent(_sock));
ServerDrv::sendData(_sock, buf, size);
while (!ServerDrv::isDataSent(_sock));
}
}