Pages: [1]   Go Down
Author Topic: How does this "dot" notation work? [solved]  (Read 624 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I see some code like this in the USB firmware files (Descriptors.c):

Code:
const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},

.USBSpecification       = VERSION_BCD(01.10),
.Class                  = USB_CSCP_NoDeviceClass,
.SubClass               = USB_CSCP_NoDeviceSubclass,
.Protocol               = USB_CSCP_NoDeviceProtocol,

.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,

.VendorID               = 0x03EB,
.ProductID              = 0x2067,
.ReleaseNumber          = VERSION_BCD(00.01),

.ManufacturerStrIndex   = NO_DESCRIPTOR,
.ProductStrIndex        = NO_DESCRIPTOR,
.SerialNumStrIndex      = NO_DESCRIPTOR,

.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
};

I'm not familiar with the use of dots in this way (eg. .Header). A Google search doesn't seem to come up with much except the usual stuff about dots separating things (eg. Serial.print) or some references to Java or Objective C.

Can anyone point me to some explanation about what this syntax means?
« Last Edit: May 26, 2012, 07:24:43 pm by Nick Gammon » Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm, looks like it is C99:

http://stackoverflow.com/questions/5052206/device-descriptor-in-lufa-what-kind-of-structure-is-this-inside-i-think-it
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Pages: [1]   Go Up
Jump to: