#include "util.h"
#include "worker.h"
-#include "msgheader.pb.h"
+#include "hardware/ril/mock-ril/src/proto/msgheader.pb.h"
-#include "ctrl.pb.h"
+#include "hardware/ril/mock-ril/src/proto/ctrl.pb.h"
#include "ctrl_server.h"
//#define CONTROL_SERVER_DEBUG
#ifdef CONTROL_SERVER_DEBUG
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
#else
server_accept_socket_ = socket_inaddr_any_server(
MOCK_RIL_CONTROL_SERVER_SOCKET, SOCK_STREAM);
if (server_accept_socket_ < 0) {
- LOGE("CtrlServerThread::Run error creating server_accept_socket_ '%s'",
+ ALOGE("CtrlServerThread::Run error creating server_accept_socket_ '%s'",
strerror(errno));
return STATUS_ERR;
}
stop_server_fd_ = socket_loopback_server(
MOCK_RIL_CONTROL_SERVER_STOPPING_SOCKET, SOCK_STREAM);
if (stop_server_fd_ < 0) {
- LOGE("CtrlServerThread::Run error creating stop_server_fd_ '%s'",
+ ALOGE("CtrlServerThread::Run error creating stop_server_fd_ '%s'",
strerror(errno));
return STATUS_ERR;
}
stop_client_fd_ = socket_loopback_client(
MOCK_RIL_CONTROL_SERVER_STOPPING_SOCKET, SOCK_STREAM);
if (stop_client_fd_ < 0) {
- LOGE("CtrlServerThread::Run error creating stop_client_fd_ '%s'",
+ ALOGE("CtrlServerThread::Run error creating stop_client_fd_ '%s'",
strerror(errno));
return STATUS_ERR;
}
// Accept the connection of the stop_client_fd_
stopper_fd_ = accept(stop_server_fd_, NULL, NULL);
if (stopper_fd_ < 0) {
- LOGE("CtrlServerThread::Run error accepting stop_client_fd '%s'",
+ ALOGE("CtrlServerThread::Run error accepting stop_client_fd '%s'",
strerror(errno));
return STATUS_ERR;
}
done_ = true;
int rv = send(stop_client_fd_, &done_, sizeof(done_), 0);
if (rv <= 0) {
- LOGE("CtrlServerThread::Stop could not send stop"
+ ALOGE("CtrlServerThread::Stop could not send stop"
"WE WILL PROBABLY HANG");
}
WaitUntilStopped();
}
if (status != STATUS_OK) {
- LOGE("sendToCtrlServer Error: status=%d", status);
+ ALOGE("sendToCtrlServer Error: status=%d", status);
// An error report complete now
mh->set_length_data(0);
mh->set_status(ril_proto::CTRL_STATUS_ERR);
if (status != STATUS_OK) break;
if (mh.cmd() == ril_proto::CTRL_CMD_ECHO) {
- LOGD("CtrlServerThread::Worker echo");
+ ALOGD("CtrlServerThread::Worker echo");
status = WriteMessage(&mh, buffer);
if (status != STATUS_OK) break;
} else {
*/
if (args.Length() < 3) {
// Expecting a reqNum, ERROR and token
- LOGE("SendCtrlRequestComplete X %d parameters"
+ ALOGE("SendCtrlRequestComplete X %d parameters"
" expecting at least 3: status, reqNum, and token",
args.Length());
return v8::Undefined();
g_ctrl_server = new CtrlServerThread(context);
status = g_ctrl_server->Run();
if (status != STATUS_OK) {
- LOGE("mock_ril control server could not start");
+ ALOGE("mock_ril control server could not start");
} else {
- LOGD("CtrlServer started");
+ ALOGD("CtrlServer started");
}
#if 0
- LOGD("Test CtrlServerThread stop sleeping 10 seconds...");
+ ALOGD("Test CtrlServerThread stop sleeping 10 seconds...");
v8::Unlocker unlocker;
sleep(10);
- LOGD("Test CtrlServerThread call Stop");
+ ALOGD("Test CtrlServerThread call Stop");
g_ctrl_server->Stop();
v8::Locker locker;
g_ctrl_server = new CtrlServerThread(context);
status = g_ctrl_server->Run();
if (status != STATUS_OK) {
- LOGE("mock_ril control server could not start");
+ ALOGE("mock_ril control server could not start");
} else {
DBG("mock_ril control server started");
}