some cleanups and styling by Mika and me

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28915 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2009-01-16 20:32:19 +00:00
parent 6dec91b4e8
commit e5da0ec57e
8 changed files with 243 additions and 278 deletions
+5 -19
View File
@@ -21,28 +21,14 @@ static inline void bacpy(bdaddr_t* dst, bdaddr_t* src)
} }
static inline void baswap(bdaddr_t* dst, bdaddr_t* src) { static inline void baswap(bdaddr_t* dst, bdaddr_t* src)
}
static inline char* batostr(bdaddr_t *ba)
{ {
return "00:00:00:00:00:00"; register uint8* d = (uint8*)dst;
register uint8* s = (uint8*)src;
register int i;
} for(i=0; i<6; i++) d[i] = s[5-i];
static inline void strtoba(const char *str, bdaddr_t *ba)
{
}
/* Link key Management */
static inline char* lktostr( uint8 link_key[16] )
{
return "00:00:00:00:00:00";
} }
+40 -70
View File
@@ -1,6 +1,6 @@
/* /*
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com * Copyright 2007-2009 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
* * Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
* All rights reserved. Distributed under the terms of the MIT License. * All rights reserved. Distributed under the terms of the MIT License.
* *
*/ */
@@ -9,14 +9,12 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <Entry.h> #include <Entry.h>
#include <Path.h>
#include <Message.h>
#include <Directory.h> #include <Directory.h>
#include <String.h> #include <Message.h>
#include <Path.h>
#include <Roster.h> #include <Roster.h>
#include <String.h>
#include <TypeConstants.h> #include <TypeConstants.h>
#include <syslog.h> #include <syslog.h>
@@ -40,15 +38,14 @@ BluetoothServer::BluetoothServer() : BApplication(BLUETOOTH_SIGNATURE)
Output::Instance()->AddTab("Events", BLACKBOARD_EVENTS); Output::Instance()->AddTab("Events", BLACKBOARD_EVENTS);
Output::Instance()->AddTab("Kit", BLACKBOARD_KIT); Output::Instance()->AddTab("Kit", BLACKBOARD_KIT);
ShowWindow(Output::Instance()); ShowWindow(Output::Instance());
fDeviceManager = new DeviceManager(); fDeviceManager = new DeviceManager();
fLocalDevicesList.MakeEmpty(); fLocalDevicesList.MakeEmpty();
// TODO: Some events should be handled faster than in KL... // TODO: Some events should be handled faster than in KL...
fEventListener = spawn_thread(notification_Thread, "BT port listener" , B_URGENT_DISPLAY_PRIORITY , this); fEventListener = spawn_thread(notification_Thread, "BT port listener" ,
B_URGENT_DISPLAY_PRIORITY , this);
} }
@@ -58,36 +55,29 @@ bool BluetoothServer::QuitRequested(void)
Output::Instance()->Lock(); Output::Instance()->Lock();
Output::Instance()->Quit(); Output::Instance()->Quit();
LocalDeviceImpl* ldi = NULL;
/* HCIDelegate *hd = NULL; while ((ldi = (LocalDeviceImpl *)fLocalDevicesList.RemoveItem((int32)0))
while ((hd = (HCIDelegate *)fDelegatesList.RemoveItem((int32)0)) !=NULL) != NULL)
delete hd; delete ldi;
*/
printf("Accepting quitting of the application\n"); printf("Accepting quitting of the application\n");
return BApplication::QuitRequested(); return BApplication::QuitRequested();
} }
void BluetoothServer::ArgvReceived(int32 argc, char **argv) void BluetoothServer::ArgvReceived(int32 argc, char **argv)
{ {
if (argc>1) { if (argc>1) {
if (strcmp(argv[1], "--finish") == 0) if (strcmp(argv[1], "--finish") == 0)
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
else {
}
} }
} }
void BluetoothServer::ReadyToRun(void) { void BluetoothServer::ReadyToRun(void)
{
fDeviceManager->StartMonitoringDevice("bluetooth/h2generic"); fDeviceManager->StartMonitoringDevice("bluetooth/h2generic");
// Launch the notifier thread // Launch the notifier thread
if ( resume_thread(fEventListener) != B_OK ) if ( resume_thread(fEventListener) != B_OK )
{ {
@@ -97,52 +87,49 @@ void BluetoothServer::ReadyToRun(void) {
Output::Instance()->Post("Bluetooth server Ready\n", BLACKBOARD_GENERAL); Output::Instance()->Post("Bluetooth server Ready\n", BLACKBOARD_GENERAL);
} }
void BluetoothServer::AppActivated(bool act) {
void BluetoothServer::AppActivated(bool act)
{
printf("Activated %d\n",act); printf("Activated %d\n",act);
} }
void BluetoothServer::MessageReceived(BMessage *message) void BluetoothServer::MessageReceived(BMessage *message)
{ {
BMessage reply; BMessage reply;
status_t status = B_WOULD_BLOCK; // mark somehow.. do not reply anything status_t status = B_WOULD_BLOCK;
// mark somehow.. do not reply anything
switch(message->what) switch(message->what)
{ {
case BT_MSG_ADD_DEVICE: case BT_MSG_ADD_DEVICE:
{ {
BString str; BString str;
message->FindString("name", &str); message->FindString("name", &str);
BPath path(str.String()); BPath path(str.String());
Output::Instance()->Postf(BLACKBOARD_GENERAL,
(Output::Instance()->Postf(BLACKBOARD_GENERAL, "Requested LocalDevice %s\n", str.String())); "Requested LocalDevice %s\n", str.String());
LocalDeviceImpl* ldi = LocalDeviceImpl::CreateTransportAccessor(&path); LocalDeviceImpl* ldi = LocalDeviceImpl::CreateTransportAccessor(&path);
if (ldi->GetID() >= 0) { if (ldi->GetID() >= 0) {
fLocalDevicesList.AddItem(ldi); fLocalDevicesList.AddItem(ldi);
Output::Instance()->AddTab("Local Device", BLACKBOARD_LD(ldi->GetID())); Output::Instance()->AddTab("Local Device", BLACKBOARD_LD(ldi->GetID()));
(Output::Instance()->Postf(BLACKBOARD_LD(ldi->GetID()), "LocalDevice %s id=%x added\n", str.String(), ldi->GetID())); Output::Instance()->Postf(BLACKBOARD_LD(ldi->GetID()),
"LocalDevice %s id=%x added\n",
str.String(), ldi->GetID());
} else { } else {
(Output::Instance()->Post("Adding LocalDevice failed\n", BLACKBOARD_GENERAL)); Output::Instance()->Post("Adding LocalDevice failed\n",
BLACKBOARD_GENERAL);
} }
status = B_WOULD_BLOCK; status = B_WOULD_BLOCK;
/* TODO: This should be by user request only! */ /* TODO: This should be by user request only! */
ldi->Launch(); ldi->Launch();
} }
break;
case BT_MSG_COUNT_LOCAL_DEVICES: case BT_MSG_COUNT_LOCAL_DEVICES:
status = HandleLocalDevicesCount(message, &reply); status = HandleLocalDevicesCount(message, &reply);
break; break;
case BT_MSG_ACQUIRE_LOCAL_DEVICE: case BT_MSG_ACQUIRE_LOCAL_DEVICE:
status = HandleAcquireLocalDevice(message, &reply); status = HandleAcquireLocalDevice(message, &reply);
break; break;
@@ -150,8 +137,6 @@ void BluetoothServer::MessageReceived(BMessage *message)
case BT_MSG_HANDLE_SIMPLE_REQUEST: case BT_MSG_HANDLE_SIMPLE_REQUEST:
status = HandleSimpleRequest(message, &reply); status = HandleSimpleRequest(message, &reply);
break; break;
/* Handle if the bluetooth preferences is running?? */ /* Handle if the bluetooth preferences is running?? */
case B_SOME_APP_LAUNCHED: case B_SOME_APP_LAUNCHED:
{ {
@@ -166,7 +151,6 @@ void BluetoothServer::MessageReceived(BMessage *message)
return; return;
} }
default: default:
BApplication::MessageReceived(message); BApplication::MessageReceived(message);
break; break;
@@ -179,7 +163,6 @@ void BluetoothServer::MessageReceived(BMessage *message)
message->SendReply(&reply); message->SendReply(&reply);
printf("Sending reply message\n"); printf("Sending reply message\n");
} }
} }
#if 0 #if 0
@@ -192,37 +175,31 @@ BluetoothServer::LocateDelegateFromMessage(BMessage* message)
LocalDeviceImpl* ldi = NULL; LocalDeviceImpl* ldi = NULL;
hci_id hid; hci_id hid;
if (message->FindInt32("hci_id", &hid) == B_OK) if (message->FindInt32("hci_id", &hid) == B_OK) {
{
/* Try to find out when a ID was specified */ /* Try to find out when a ID was specified */
int index; int index;
for (index = 0; index < fLocalDevicesList.CountItems(); index ++) { for (index = 0; index < fLocalDevicesList.CountItems(); index ++) {
ldi = fLocalDevicesList.ItemAt(index); ldi = fLocalDevicesList.ItemAt(index);
if (ldi->GetID() == hid) { if (ldi->GetID() == hid)
break; break;
} }
} }
}
return ldi; return ldi;
} }
LocalDeviceImpl* LocalDeviceImpl*
BluetoothServer::LocateLocalDeviceImpl(hci_id hid) BluetoothServer::LocateLocalDeviceImpl(hci_id hid)
{ {
/* Try to find out when a ID was specified */ /* Try to find out when a ID was specified */
int index; int index;
for (index = 0; index < fLocalDevicesList.CountItems(); index ++) { for (index = 0; index < fLocalDevicesList.CountItems(); index ++) {
LocalDeviceImpl* ldi = fLocalDevicesList.ItemAt(index); LocalDeviceImpl* ldi = fLocalDevicesList.ItemAt(index);
if (ldi->GetID() == hid) { if (ldi->GetID() == hid)
return ldi; return ldi;
} }
}
return NULL; return NULL;
} }
@@ -250,29 +227,29 @@ BluetoothServer::HandleAcquireLocalDevice(BMessage* message, BMessage* reply)
if (message->FindInt32("hci_id", &hid) == B_OK) if (message->FindInt32("hci_id", &hid) == B_OK)
{ {
Output::Instance()->Post("GetLocalDevice requested with id\n", BLACKBOARD_KIT); Output::Instance()->Post("GetLocalDevice requested with id\n",
BLACKBOARD_KIT);
ldi = LocateDelegateFromMessage(message); ldi = LocateDelegateFromMessage(message);
} else if (message->FindData("bdaddr", B_ANY_TYPE, (const void**)&bdaddr, &size ) == B_OK) } else if (message->FindData("bdaddr", B_ANY_TYPE, (const void**)&bdaddr, &size )
{ == B_OK) {
/* Try to find out when the user specified the address */ /* Try to find out when the user specified the address */
Output::Instance()->Post("GetLocalDevice requested with bdaddr\n", BLACKBOARD_KIT); Output::Instance()->Post("GetLocalDevice requested with bdaddr\n",
BLACKBOARD_KIT);
for (index = 0; index < fLocalDevicesList.CountItems(); index ++) { for (index = 0; index < fLocalDevicesList.CountItems(); index ++) {
bdaddr_t local; bdaddr_t local;
ldi = fLocalDevicesList.ItemAt(index); ldi = fLocalDevicesList.ItemAt(index);
// TODO: Only if the property is available // TODO: Only if the property is available
//if ((ldi->GetAddress(&local, message) == B_OK) && bacmp(&local, &bdaddr)) { //if ((ldi->GetAddress(&local, message) == B_OK)
// && bacmp(&local, &bdaddr)) {
// break; // break;
//} //}
} }
} else } else {
{
/* Careless, any device not performing operations will be fine */ /* Careless, any device not performing operations will be fine */
Output::Instance()->Post("GetLocalDevice requested\n", BLACKBOARD_KIT); Output::Instance()->Post("GetLocalDevice requested\n", BLACKBOARD_KIT);
for (index = 0; index < fLocalDevicesList.CountItems(); index ++) { for (index = 0; index < fLocalDevicesList.CountItems(); index ++) {
ldi = fLocalDevicesList.ItemAt(index); ldi = fLocalDevicesList.ItemAt(index);
printf("Requesting local device %ld\n", ldi->GetID()); printf("Requesting local device %ld\n", ldi->GetID());
if (ldi != NULL && ldi->Available()) if (ldi != NULL && ldi->Available())
@@ -280,12 +257,10 @@ BluetoothServer::HandleAcquireLocalDevice(BMessage* message, BMessage* reply)
printf("dev ours %ld\n", ldi->GetID()); printf("dev ours %ld\n", ldi->GetID());
break; break;
} }
} }
} }
if (index <= fLocalDevicesList.CountItems() && ldi != NULL && ldi->Available()) if (index <= fLocalDevicesList.CountItems() && ldi != NULL && ldi->Available()) {
{
Output::Instance()->Post("Device acquired\n", BLACKBOARD_KIT); Output::Instance()->Post("Device acquired\n", BLACKBOARD_KIT);
ldi->Acquire(); ldi->Acquire();
return reply->AddInt32("hci_id", hid); return reply->AddInt32("hci_id", hid);
@@ -299,26 +274,21 @@ BluetoothServer::HandleAcquireLocalDevice(BMessage* message, BMessage* reply)
status_t status_t
BluetoothServer::HandleSimpleRequest(BMessage* message, BMessage* reply) BluetoothServer::HandleSimpleRequest(BMessage* message, BMessage* reply)
{ {
LocalDeviceImpl* ldi = LocateDelegateFromMessage(message); LocalDeviceImpl* ldi = LocateDelegateFromMessage(message);
BString propertyRequested; BString propertyRequested;
// Find out if there is a property being requested, // Find out if there is a property being requested,
if (message->FindString("property", &propertyRequested) == B_OK) { if (message->FindString("property", &propertyRequested) == B_OK) {
// Check if the property has been already retrieved // Check if the property has been already retrieved
if (ldi->IsPropertyAvailable(propertyRequested)) { if (ldi->IsPropertyAvailable(propertyRequested)) {
// Dump everything // Dump everything
reply->AddMessage("properties",ldi->GetPropertiesMessage()); reply->AddMessage("properties",ldi->GetPropertiesMessage());
return B_OK; return B_OK;
} }
} }
// we are gonna need issue the command ... // we are gonna need issue the command ...
if (ldi->ProcessSimpleRequest(DetachCurrentMessage()) == B_OK) if (ldi->ProcessSimpleRequest(DetachCurrentMessage()) == B_OK)
// if (ldi->ProcessSimpleRequest(message) == B_OK)
return B_WOULD_BLOCK; return B_WOULD_BLOCK;
else else
return B_ERROR; return B_ERROR;
+24 -10
View File
@@ -1,10 +1,8 @@
/* /*
* Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com * Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
* * Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
* All rights reserved. Distributed under the terms of the MIT License. * All rights reserved. Distributed under the terms of the MIT License.
*
*/ */
#ifndef _HCIDELEGATE_H_ #ifndef _HCIDELEGATE_H_
#define _HCIDELEGATE_H_ #define _HCIDELEGATE_H_
@@ -30,10 +28,12 @@ class HCIDelegate {
if (fFD > 0) { if (fFD > 0) {
// find out which ID was assigned // find out which ID was assigned
status = ioctl(fFD, GET_HCI_ID, &fHID, 0); status = ioctl(fFD, GET_HCI_ID, &fHID, 0);
printf("%s: hid retrieved %lx status=%ld\n", __FUNCTION__, fHID, status); printf("%s: hid retrieved %lx status=%ld\n", __FUNCTION__,
fHID, status);
} }
else { else {
printf("%s: Device driver could not be opened %ld\n", __FUNCTION__, fHID); printf("%s: Device driver could not be opened %ld\n", __FUNCTION__,
fHID);
fHID = B_ERROR; fHID = B_ERROR;
} }
@@ -47,23 +47,37 @@ class HCIDelegate {
return fHID; return fHID;
} }
virtual status_t IssueCommand(raw_command rc, size_t size)=0; // TODO means to be private
virtual ~HCIDelegate()
{
if (fFD > 0)
{
close (fFD);
fFD = -1;
fHID = B_ERROR;
}
}
virtual status_t IssueCommand(raw_command rc, size_t size)=0;
// TODO means to be private use QueueCommand
virtual status_t Launch()=0; virtual status_t Launch()=0;
void FreeWindow(uint8 slots) { // TODO: hci control flow
void FreeWindow(uint8 slots)
{
// TODO: hci control flow
} }
status_t QueueCommand(raw_command rc, size_t size) status_t QueueCommand(raw_command rc, size_t size)
{ {
// TODO: this is suposed to queue the command in a queue so all are actually send to HW // TODO: this is suposed to queue the command in a queue so all
// are actually send to HW
return IssueCommand(rc, size); return IssueCommand(rc, size);
} }
protected: protected:
hci_id fHID; hci_id fHID;
int fFD; int fFD;
+25 -25
View File
@@ -1,25 +1,22 @@
/* /*
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com * Copyright 2007-2009 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
* * Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
* All rights reserved. Distributed under the terms of the MIT License. * All rights reserved. Distributed under the terms of the MIT License.
*
*/ */
#include "LocalDeviceHandler.h" #include "LocalDeviceHandler.h"
LocalDeviceHandler::LocalDeviceHandler(HCIDelegate* hd) LocalDeviceHandler::LocalDeviceHandler(HCIDelegate* hd)
{ {
fHCIDelegate = hd; fHCIDelegate = hd;
fProperties = new BMessage(); fProperties = new BMessage();
} }
LocalDeviceHandler::~LocalDeviceHandler() LocalDeviceHandler::~LocalDeviceHandler()
{ {
delete fProperties;
} }
@@ -29,6 +26,7 @@ LocalDeviceHandler::GetID()
return fHCIDelegate->GetID(); return fHCIDelegate->GetID();
} }
status_t status_t
LocalDeviceHandler::Launch(void) LocalDeviceHandler::Launch(void)
{ {
@@ -37,26 +35,27 @@ LocalDeviceHandler::Launch(void)
bool bool
LocalDeviceHandler::Available() { LocalDeviceHandler::Available()
{
return true; return true;
} }
void void
LocalDeviceHandler::Acquire(void) { LocalDeviceHandler::Acquire(void)
{
} }
bool bool
LocalDeviceHandler::IsPropertyAvailable(const BString& property) { LocalDeviceHandler::IsPropertyAvailable(const BString& property)
{
type_code typeFound; type_code typeFound;
int32 countFound; int32 countFound;
return (fProperties->GetInfo(property.String(), &typeFound, &countFound) == B_OK ); return (fProperties->GetInfo(property.String(), &typeFound, &countFound) == B_OK );
} }
@@ -70,13 +69,13 @@ LocalDeviceHandler::AddWantedEvent(BMessage* msg)
fEventsWanted.Unlock(); fEventsWanted.Unlock();
} }
void void
LocalDeviceHandler::ClearWantedEvent(BMessage* msg) LocalDeviceHandler::ClearWantedEvent(BMessage* msg)
{ {
fEventsWanted.Lock(); fEventsWanted.Lock();
fEventsWanted.RemoveMessage(msg); fEventsWanted.RemoveMessage(msg);
fEventsWanted.Unlock(); fEventsWanted.Unlock();
} }
@@ -102,11 +101,12 @@ LocalDeviceHandler::ClearWantedEvent(BMessage* msg, uint16 event, uint16 opcode)
if (opcode != 0) { if (opcode != 0) {
// The opcode matches // The opcode matches
if ( (msg->FindInt16("opcodeExpected", eventIndex, &opcodeFound) == B_OK) && if ( (msg->FindInt16("opcodeExpected", eventIndex, &opcodeFound) == B_OK)
((uint16)opcodeFound == opcode) ) { && ((uint16)opcodeFound == opcode) ) {
// this should remove only the entry // this should remove only the entry
printf("Removed event %#x and opcode %d from request %p\n", event, opcode, msg); printf("Removed event %#x and opcode %d from request %p\n",
event, opcode, msg);
(void)msg->RemoveData("eventExpected", eventIndex); (void)msg->RemoveData("eventExpected", eventIndex);
(void)msg->RemoveData("opcodeExpected", eventIndex); (void)msg->RemoveData("opcodeExpected", eventIndex);
goto finish; goto finish;
@@ -141,8 +141,8 @@ LocalDeviceHandler::FindPetition(uint16 event, uint16 opcode, int32* indexFound)
// for each Petition // for each Petition
for (int32 index = 0 ; index < fEventsWanted.CountMessages() ; index++) { for (int32 index = 0 ; index < fEventsWanted.CountMessages() ; index++) {
BMessage* msg = fEventsWanted.FindMessage(index); BMessage* msg = fEventsWanted.FindMessage(index);
printf("%s:Petition %ld ... of %ld msg #%p\n", __FUNCTION__, index,
printf("%s:Petition %ld ... of %ld msg #%p\n", __FUNCTION__, index, fEventsWanted.CountMessages(), msg); fEventsWanted.CountMessages(), msg);
//msg->PrintToStream(); //msg->PrintToStream();
eventIndex = 0; eventIndex = 0;
@@ -152,24 +152,23 @@ LocalDeviceHandler::FindPetition(uint16 event, uint16 opcode, int32* indexFound)
printf("%s:Event found@%ld...", __FUNCTION__, eventIndex); printf("%s:Event found@%ld...", __FUNCTION__, eventIndex);
// there is an opcode specified.. // there is an opcode specified..
if (msg->FindInt16("opcodeExpected", eventIndex, &opcodeFound) == B_OK) { if (msg->FindInt16("opcodeExpected", eventIndex, &opcodeFound)
== B_OK) {
// ensure the opcode // ensure the opcode
if ((uint16)opcodeFound != opcode) { if ((uint16)opcodeFound != opcode) {
printf("%s:opcode does not match %d\n",__FUNCTION__, opcode); printf("%s:opcode does not match %d\n",
__FUNCTION__, opcode);
break; break;
} }
printf("opcode match %d\n", opcode); printf("Opcode matches %d\n", opcode);
} else { } else {
printf("no opcode specified\n"); printf("No opcode specified\n");
} }
fEventsWanted.Unlock(); fEventsWanted.Unlock();
if (indexFound != NULL) if (indexFound != NULL)
*indexFound = eventIndex; *indexFound = eventIndex;
return msg; return msg;
} }
eventIndex++; eventIndex++;
} }
@@ -178,4 +177,5 @@ LocalDeviceHandler::FindPetition(uint16 event, uint16 opcode, int32* indexFound)
fEventsWanted.Unlock(); fEventsWanted.Unlock();
return NULL; return NULL;
} }
@@ -82,23 +82,18 @@ printf("### \n");
case HCI_EVENT_CONN_REQUEST: case HCI_EVENT_CONN_REQUEST:
ConnectionRequest((struct hci_ev_conn_request*)(event+1), NULL); ConnectionRequest((struct hci_ev_conn_request*)(event+1), NULL);
return; return;
case HCI_EVENT_CONN_COMPLETE: case HCI_EVENT_CONN_COMPLETE:
// should belong to a request? can be sporadic or initiated by us¿?... // should belong to a request? can be sporadic or initiated by us¿?...
ConnectionComplete((struct hci_ev_conn_complete*)(event+1), NULL); ConnectionComplete((struct hci_ev_conn_complete*)(event+1), NULL);
return; return;
case HCI_EVENT_PIN_CODE_REQ: case HCI_EVENT_PIN_CODE_REQ:
PinCodeRequest((struct hci_ev_pin_code_req*)(event+1), NULL); PinCodeRequest((struct hci_ev_pin_code_req*)(event+1), NULL);
return; return;
default: default:
// lets go on // lets go on
break; break;
} }
BMessage* request = NULL; BMessage* request = NULL;
int32 eventIndexLocation; int32 eventIndexLocation;