Subject:
|
Re: mindstorms sdk
|
Newsgroups:
|
lugnet.robotics.nxt
|
Date:
|
Tue, 21 Aug 2007 23:44:57 GMT
|
Viewed:
|
20260 times
|
| |
| |
In lugnet.robotics.nxt, Elizabeth Mabrey wrote:
> Would someone tell me the link to the sdk site where I can find the proper
> iomap . the one in the nxc guide.pdf seems to be off somewhere. we were
> playing with the comm. Module map,. the offset is off!!!
I think you might very well be right since some things just don't seem to work
right for some folks who have tried that particular IOMap. But I haven't been
able to find where it is off yet. Which offset were you trying to use?
You need to look in the firmware source code to figure out the IOMap offsets.
They are not documented anywhere. I calculated them all manually by looking in
the *.iom files in the firmware code. The contents of the c_comm.iom file are
below. You may need a few #define constants from other files. If anyone can
help get these values correct I would be most grateful.
John Hansen
#ifndef CCOMM_IOM
#define CCOMM_IOM
#define pMapComm ((IOMAPCOMM*)(pHeaders[ENTRY_COMM]->pIOMap))
#define SIZE_OF_USBBUF 64
#define USB_PROTOCOL_OVERHEAD 1 + 1 /* Command type byte + Command */
#define SIZE_OF_USBDATA (SIZE_OF_USBBUF - USB_PROTOCOL_OVERHEAD)
#define SIZE_OF_HSBUF 128
#define SIZE_OF_BTBUF 128
#define BT_CMD_BYTE 1
#define SIZE_OF_BT_DEVICE_TABLE 30
#define SIZE_OF_BT_CONNECT_TABLE 4 /* Index 0 is alway incomming connections */
#define MAX_BT_MSG_SIZE 60000L
#define BT_DEFAULT_INQUIRY_MAX 0 /* Unlimited no */
#define BT_DEFAULT_INQUIRY_TIMEOUT_LO 15 /* 15 x 1,28 Sec = 19,2 Sec */
// Constants reffering to BtState
enum
{
BT_ARM_OFF,
BT_ARM_CMD_MODE,
BT_ARM_DATA_MODE,
};
//Constant reffering to BtStateStatus
#define BT_BRICK_VISIBILITY 0x01
#define BT_BRICK_PORT_OPEN 0x02
#define BT_CONNECTION_0_ENABLE 0x10
#define BT_CONNECTION_1_ENABLE 0x20
#define BT_CONNECTION_2_ENABLE 0x40
#define BT_CONNECTION_3_ENABLE 0x80
//Constant reffering to BtHwStatus
#define BT_ENABLE 0x00
#define BT_DISABLE 0x01
// Constants reffering to HsFlags
enum
{
HS_UPDATE = 1
};
// Constants reffering to HsState
enum
{
HS_INITIALISE = 1,
HS_INIT_RECEIVER,
HS_SEND_DATA,
HS_DISABLE
};
//Constants refering to DeviceStatus within DeviceTable
enum
{
BT_DEVICE_EMPTY = 0x00,
BT_DEVICE_UNKNOWN = 0x01,
BT_DEVICE_KNOWN = 0x02,
BT_DEVICE_NAME = 0x40,
BT_DEVICE_AWAY = 0x80
};
/* Interface between command other modules */
enum
{
SENDFILE,
SEARCH,
STOPSEARCH,
CONNECT,
DISCONNECT,
DISCONNECTALL,
REMOVEDEVICE,
VISIBILITY,
SETCMDMODE,
OPENSTREAM,
SENDDATA,
FACTORYRESET,
BTON,
BTOFF,
SETBTNAME,
EXTREAD,
PINREQ,
CONNECTREQ
};
enum
{
LR_SUCCESS = 0x50,
LR_COULD_NOT_SAVE,
LR_STORE_IS_FULL,
LR_ENTRY_REMOVED,
LR_UNKOWN_ADDR
};
enum
{
USB_CMD_READY = 0x01,
BT_CMD_READY = 0x02,
HS_CMD_READY = 0x04
};
typedef struct
{
UBYTE Buf[SIZE_OF_USBBUF];
UBYTE InPtr;
UBYTE OutPtr;
UBYTE Spare1;
UBYTE Spare2;
}USBBUF;
typedef struct
{
UBYTE Buf[SIZE_OF_HSBUF];
UBYTE InPtr;
UBYTE OutPtr;
UBYTE Spare1;
UBYTE Spare2;
}HSBUF;
typedef struct
{
UBYTE Buf[SIZE_OF_BTBUF];
UBYTE InPtr;
UBYTE OutPtr;
UBYTE Spare1;
UBYTE Spare2;
}BTBUF;
typedef struct
{
UBYTE Name[SIZE_OF_BT_NAME];
UBYTE ClassOfDevice[SIZE_OF_CLASS_OF_DEVICE];
UBYTE BdAddr[SIZE_OF_BDADDR];
UBYTE DeviceStatus;
UBYTE Spare1;
UBYTE Spare2;
UBYTE Spare3;
}BDDEVICETABLE;
typedef struct
{
UBYTE Name[SIZE_OF_BT_NAME];
UBYTE ClassOfDevice[SIZE_OF_CLASS_OF_DEVICE];
UBYTE PinCode[16];
UBYTE BdAddr[SIZE_OF_BDADDR];
UBYTE HandleNr;
UBYTE StreamStatus;
UBYTE LinkQuality;
UBYTE Spare;
}BDCONNECTTABLE;
typedef struct
{
UBYTE Name[SIZE_OF_BT_NAME];
UBYTE BluecoreVersion[2];
UBYTE BdAddr[SIZE_OF_BDADDR];
UBYTE BtStateStatus;
UBYTE BtHwStatus;
UBYTE TimeOutValue;
UBYTE Spare1;
UBYTE Spare2;
UBYTE Spare3;
}BRICKDATA;
typedef struct
{
UWORD (*pFunc)(UBYTE, UBYTE, UBYTE, UBYTE, UBYTE*, UWORD*);
void (*pFunc2)(UBYTE*);
// BT related entries
BDDEVICETABLE BtDeviceTable[SIZE_OF_BT_DEVICE_TABLE];
BDCONNECTTABLE BtConnectTable[SIZE_OF_BT_CONNECT_TABLE];
//General brick data
BRICKDATA BrickData;
BTBUF BtInBuf;
BTBUF BtOutBuf;
// HI Speed related entries
HSBUF HsInBuf;
HSBUF HsOutBuf;
// USB related entries
USBBUF UsbInBuf;
USBBUF UsbOutBuf;
USBBUF UsbPollBuf;
UBYTE BtDeviceCnt;
UBYTE BtDeviceNameCnt;
UBYTE HsFlags;
UBYTE HsSpeed;
UBYTE HsState;
UBYTE UsbState;
}IOMAPCOMM;
|
|
Message has 1 Reply: | | Re: mindstorms sdk
|
| (...) Unfortunately, I have verified beyond any possible doubt that the comm module offsets in NBCCommon.h (as well as the offsets for all the other modules) are correct. I had really hoped that there was a bug here. What I did to verify the values (...) (17 years ago, 22-Aug-07, to lugnet.robotics.nxt)
|
Message is in Reply To:
| | mindstorms sdk
|
| Would someone tell me the link to the sdk site where I can find the proper iomap . the one in the nxc guide.pdf seems to be off somewhere. we were playing with the comm. Module map,. the offset is off!!! Elizabeth (17 years ago, 21-Aug-07, to lugnet.robotics.nxt)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in NXT programmable brick
|
|
|
|