Skip to content

Structures

Josh Miller edited this page Mar 16, 2016 · 78 revisions

Structures

##Cylon.h

###struct cylonStruct cylonStruct acts as a container for holding user profile information, system settings, and hardware specifications, and should be compatible with Foster, as well as any other libraries as part of the Centurion project.

####Variables ####Time

  • uint32_t milliseconds
  • current milliseconds for local time
  • uint32_t seconds
  • current seconds for local time
  • uint32_t minutes
  • current minutes for local time
  • uint32_t hours
  • current hours for local time, represented in 24 hour clock format

####Date

  • uint32_t day
  • day of the week, supported values are:
    • 0 = Sunday
    • 1 = Monday
    • 2 = Tuesday
    • 3 = Wednesday
    • 4 = Thursday
    • 5 = Friday
    • 6 = Saturday
  • uint32_t date
  • today's date, 1-31
  • uint32_t month
  • _the current month, supported values are:
    • 1 = January
    • 2 = February
    • 3 = March
    • 4 = April
    • 5 = May
    • 6 = June
    • 7 = July
    • 8 = August
    • 9 = September
    • 10 = October
    • 11 = November
    • 12 = December
  • uint32_t year
  • the current year, valid responses are 1601 until the cows come home

####Time Zone

  • uint32_t dst
  • denotes if time is current in DST mode, supported values are:
    • 0 = standard time
    • 1 = daylight time
    • otherwise = invalid
  • int32 timeZone
  • time zone bias expressed in minutes +/- UTC
  • std::string timeZoneName
  • standard abbreviation for time zone (EST, MST, etc.)

####Processor

  • std:;string architecture
  • architecture of the processor (i.e. Itanium, etc.)
  • uint16_t processorLevel
  • placeholder for architecture-dependent processor level information provided by Windows, currently unused
  • uint32_t pageSize
  • page size utilized by processor, measured in bytes
  • uint32_t processorCount
  • number of processors detected on the current machine
  • uint32_t allocationGranularity
  • granularity for starting address where virtual memory can be allocated
  • uintptr_t minAppAddress
  • lowest address in memory that an application can access
  • uintptr_t maxAppAaddress
  • highest address in memory that an application can access
  • uint64_t hertz
  • minimum supported value for processor speed measured in hertz

####Memory

  • uint64_t memoryBytes
  • the total installed RAM in bytes
  • uint64_t threshold
  • the amount of RAM in bytes that signifies the device is running low on memory
  • uint64_t bytesAvails
  • the amount of RAM free in bytes
  • int lowMemory
  • a value of 1 denotes that the device is running low on memory, otherwise the value is set to 0
  • uint32_t osArchitecture
  • operating system bit-level architecture, current supported values are:
    • 32 = 32-bit OS
    • 64 = 64-bit OS

####Account Picture

  • uintptr_t pictureLocation
  • address value of pointer to a container for the presently logged-in user's account picture
  • std::string pictureType
  • gives the file extension of the picture variable, used for debugging purposes
  • std::string picturePath
  • the file system path where the picture is stored

####Device Information

  • uint32_t installedDeviceCount
  • total number of installed devices detected
  • uint32_t detectedDeviceCount
  • total number of currently detected devices
  • uint32_t portableStorageCount
  • total number of currently attached portable storage devices
  • uint32_t videoCount
  • total number of currently attached video capture devices
  • uint32_t micCount
  • total number of currently attached audio capture devices
  • uint32_t speakerCount
  • total number of currently attached audio rendering devices
  • uint32_t locationCount
  • total number of currently attached location aware devices
  • uint32_t scannerCount
  • total number of currently attached image scanning devices
  • std::list detectedDevices
  • doubly linked list filled with nodes of type deviceStruct, for holding all detected devices' metadata
  • std::list displayDevices
  • doubly linked list filled with nodes of type displayStruct, for holding all detected displays' metadata
  • std::list controllers
  • doubly linked list filled with nodes of type controllerStruct, for holding all detected controller's metadata
  • std::list storages
  • doubly linked list filled with nodes of type storageStruct
  • std::list sensors
  • doubly linked list filled with nodes of type sensorsStruct
  • std::list midiDevices
  • doubly linked list filled with nodes of type midiStruct
  • struct mouseStruct mice
  • holds pooled metadata for all detected mice in a singular container

####Error

  • int32 error
  • placeholder for returning errors

###struct deviceStruct deviceStruct acts as a container for holding specific information for a detected device in a singular location.

####Variables ####Type

  • uint32_t deviceType

  • denotes the type of device described in the deviceStruct. Additionally used for polymorphic structs for more specific deviceTypes that "inherit" from deviceStruct. Valid values include:

    • 0 = erroneous type
    • 1 = generic type
    • 2 = audio capture
    • 3 = audio render
    • 4 = storage
    • 5 = video capture
    • 6 = image scanner
    • 7 = location aware
    • 8 = display
    • 9 = mouse
    • 10 = keyboard
    • 11 = controller
    • 12 = touchscreen
    • 13 = touch pad
    • 14 = trackball
    • 15 = stylus
    • 16 = position
    • 17 = currently unused
    • 18 = rumble
    • 19 = sensor
    • 20 = bluetooth radio
  • uint32_t displayIndex

  • denotes the index of this deviceStruct's corresponding displayStruct IFF its type is equal to 8, otherwise the value is defaulted to zero

  • uint32_t controllerIndex

  • denotes the index of this deviceStruct's corresponding controllerStruct IFF its type is equal to 11, otherwise the value is defaulted to zero

  • uint32_t sensorsIndex

  • denotes the index of this struct's corresponding sensorStruct IFF its type is equal to 19, otherwise the value is defaulted to zero

  • uint32_t storageIndex

  • denotes the index of this struct's corresponding storageStruct IFF its type is equal to 17, otherwise the value is defaulted to zero

  • uint32_t midiIndex

  • denotes the index of this struct's corresponding midiStruct IFF its type is equal to 30, otherwise the value is defaulted to zero

  • uint32_t vendorID

  • denotes the vendor ID of the device, when available

####Location

  • uint32_t orientation
  • for cameras, denotes the orientation of the device IFF its type is equal to 5 (camera), otherwise defaults to 0. While not yet implemented, this will also extend to devices of type 8 (display)
  • uint32_t panelLocation
  • for built in devices, such as laptop webcams, this value denotes the location of the device on the computer, supported values are:
    • 0 = error/invalid/unknown
    • 1 = front
    • 2 = back
    • 3 = top
    • 4 = bottom
    • 5 = left
    • 6 = right
  • uint32_t inLid
  • true if device is located in the lid of the computer, false otherwise
  • uint32_t inDock
  • true if device is located in the dock of the computer, false otherwise

####Usability

  • uint32_t isEnabled
  • true if the device is presently enabled, false otherwise
  • uint32_t isDefault
  • true if the device is the default option for its device type, false otherwise

####Names

  • std::string wName
  • name of the device, a string of "0" denotes a device with no valid name found
  • std::string id_string
  • unique ID of the device, a string of "0" denotes a device with no valid ID found_
  • uint32_t id_int
  • unique ID of the device in integer format, when supported
  • uint32_t usb_bus
  • the usb bus number of the device, where applicable
  • uint32_t udev_deviceNumber
  • the udev device number for the device

###struct displayStruct displayStruct holds additional information for a display device not normally found in a deviceStruct, but contains a pointer to a deviceStruct so that its location may be used for the list of deviceStructs found in cylonStruct.

####Variables ####Parent

  • struct deviceStruct superDevice
  • The displayStruct's parent deviceStruct container
  • uint32_t deviceIndex
  • The superDevice's index in detectedDevices

####Rotation

  • uint32_t rotationPreference
  • the preferred rotation of the current app, supported values are:
    • 0 = none
    • 1 = landscape
    • 2 = portrait
    • 4 = flipped landscape
    • 8 = flipped portrait
  • uint32_t currentRotation
  • the current rotation of the primary monitor, supported values are:
    • 0 = none
    • 1 = landscape
    • 2 = portrait
    • 4 = flipped landscape
    • 8 = flipped portrait
  • uint32_t nativeRotation
  • the native rotation of the primary monitor, supported values are:
    • 0 = none
    • 1 = landscape
    • 2 = portrait
    • 4 = flipped landscape
    • 8 = flipped portrait

####Resolution

  • float resolutionScale
  • the current scale of the resolution in reference to the size of the primary monitor, as decimal multiplier (100% = 1.0, etc.)
  • float logicalDPI
  • the logical dots per inch of the primary monitor
  • float rawDPIX
  • the raw dots per inch across the width of the primary monitor
  • float rawDPIY
  • the raw dots per inch across the height of the primary monitor
  • uint32_t horizontalResolution
  • the horizontal resolution of the display
  • uint32_t verticalResolution
  • the vertical resolution of the display
  • uint32_t upperLeftY
  • the upper left Y pixel value for the combined screen canvas of all displays
  • uint32_t upperLeftX
  • the upper left X pixel value for the combined screen canvas of all displays

####Other

  • float refreshRate
  • the rate at which the screen refreshes
  • void driverData*
  • a pointer to driver specific data on the display
  • unsigned char colorData*
  • a data stream for the color profile of the screen
  • unsigned int colorLength
  • the size of the colorData buffer

####3D

  • uint32_t isStereoscopicEnabled
  • true of stereoscopic 3D is enabled on the primary monitor, false otherwise

###struct controllerStruct controllerStruct acts as a container for holding specific information for a detected controller in a singular location.

####Variables ####Parent

  • struct deviceStruct superDevice
  • The corresponding deviceStruct for this controllerStruct
  • uint32_t deviceIndex
  • The superDevice's index in detectedDevices

####Player

  • uint32_t userIndex
  • The player number of the controller, starting from 0 (typically 0-3 for a 4 player game, so player 1 in a given game would be userIndex 0)

####Buttons

  • uint32_t packetNumber
  • Used to track if changes to the controller have occurred between requests
  • uint16_t buttons
  • Bit mask based on Windows documentation that defines which buttons are currently being pressed
  • float leftTrigger
  • Value between 0 & 255 representing how far the left trigger is depressed
  • float rightTrigger
  • Value between 0 & 255 representing how far the right trigger is depressed
  • float thumbLeftX
  • Left thumbstick x-axis value between -32768 and 32767, a value of 0 is centered, negative values signify left, positive values signify right
  • float thumbRightX
  • Right thumbstick x-axis value between -32768 and 32767, a value of 0 is centered, negative values signify left, positive values signify right
  • float thumbLeftY
  • Left thumbstick y-axis value between 32768 and 32767, a value of 0 is centered, negative values signify down, positive values signify up
  • float thumbRightY
  • Right thumbstick y-axis value between 32768 and 32767, a value of 0 is centered, negative values signify down, positive values signify up

###struct storageStruct storageStruct stores data specific to certain devices that are used for storage capabilities.

####Variables ####Parent

  • struct deviceStruct superDevice
  • The corresponding "parent" device for the storageStruct
  • uint32_t deviceIndex
  • The superDevice's index in detectedDevices

####Properties

  • std::string path
  • The path in the OS file system to the storage drive location.
  • uint64_t bytesAvails
  • The space free in the storage drive measured in bytes
  • uint64_t totalBytes
  • The total size in bytes of the storage drive
  • uint32_t isEmulated
  • If the storage drive is emulated, 0 for no/unknown, 1 for yes

###struct sensorStruct sensorStruct stores data specific to certain devices that are used as on-board or peripheral sensors for the given operating environment.

####Variables ####Parent

  • struct deviceStruct superDevice
  • The corresponding "parent" device for the sensorStruct
  • uint32_t deviceIndex
  • The superDevice's index in detectedDevices

####Properties

  • uint32_t minDelay
  • The minimum delay allowed between two events, measured in microseconds. This value may also be 0 if the sensor only returns new data when actively observing a change in its readings.
  • uint32_t type
  • The specific type of sensor this object holds data for, based on the Android mapping found here.
  • uint32_t version
  • The release number of the given sensor.
  • std::string vendor
  • The name of the vendor for the given sensor.
  • std::string name
  • The name of the given sensor.
  • float power
  • The power drawn by the sensor, measured in mA
  • float resolution
  • The resolution the scanner uses for scans
  • uint32_t fifoMaxEventCount
  • The max number of events the sensor can have batched, a value of 0 indicates batch mode is not supported, this value is not guaranteed as other sensors may share the same batch space at run time
  • uint32_t fifoReservedEventCount
  • Guaranteed minimum number of FIFO events for the sensor that can be batch
  • std::string stringType
  • A string representation of the sensor's type
  • uint32_t maxDelay
  • _The delay between two sensor events measured in microseconds for the lowest frequency the given sensor cna operate with. Used only for continuous and on-change sensors, and invalid when less than 1.
  • uint32_t reportingMode
  • The reporting mode for the given sensor, based on the Android mapping found here
  • uint32_t isWakeUpSensor
  • Denotes if the given sensor is a wake up sensor, 1 for yes, 0 for no/unknown

###struct mididStruct midiStructs are native representations of data retrieved from the Android Midi class.

####Variables ####Parent

  • struct deviceStruct superDevice
  • The corresponding "parent" device of this MIDI device
  • uint32_t deviceIndex
  • The superDevice's index in detectedDevices

####ID

  • uint32_t id
  • The id of the MIDI device
  • uint32_t type
  • The type of MIDI device (bluetooth, usb, or virtual)

####Ports

  • uint32_t inCount
  • the number of input ports for the device
  • uint32_t outCount
  • the number of output ports for the device
  • std:list ports
  • a list of port structures for the device

####Strings

  • std::string vendorName
  • the vendor name for the device
  • std::string productName
  • the product name for the device
  • std::string deviceName
  • the device name
  • std::string versionNumber
  • the device version number
  • std::string serialNumber
  • the serial number of the device

###midiPortStruct Represents a port for a MIDI device.

####Variables

  • std::string name
  • the name of the device
  • uint32_t number
  • the port number
  • uint32_t type
  • the type (in or out) of port

###struct mouseStruct mouseStruct stores a pooled set of data on the capabilities of all attached/detected mice, it is unused for the Saul portion of the Centurion project.

####Variables ####Parent

  • struct deviceStruct superDevice
  • The corresponding "parent" deviceStruct for the mouseStruct
  • uint32_t deviceIndex
  • The superDevice's index in detectedDevices

####Properties

  • uint32_t anyRightLeftSwapped
  • True if any of the attached mice have their left/right click buttons swapped, false otherwise
  • uint32_t anyVerticalWheelPresent
  • True if any of the attached mice have a vertical wheel, false otherwise
  • uint32_t anyHorizontalWheelPresent
  • True if any of the attached mice have a horizontal wheel, false otherwise
  • uint32_t maxNumberOfButtons
  • The number of buttons found on the detected/attached mouse with the most buttons

##Foster.h ###Centurion::Tory Centurion::Tory is a helper reference class designed to make asynchronous calls to UWP API and pass the returned values back to a cylonStruct later on in run time when the async jobs have concluded. This prevents busy waiting on a bunch of tasks when populating the rest of a cylonStruct's fields.

####Properties

  • property Platform::String^ CylonName
  • Forward facing, managed String object for holding the username of the current user
  • property Platform::String^ NonRoamableId
  • Forward facing, managed String object for holding the non-roam-able id of the current user
  • property Platform::Boolean InfoReady
  • Forward facing Boolean flag for denoting if the Tory object is ready to copy its info to a receiving cylonStruct
  • property Platform::Boolean InfoCopied
  • Forward facing Boolean flag for denoting if the Tory object has already copied its info to a receiving cylonStruct
  • property IRandomAccessStreamWithContentType^ PictureStream
  • Forward facing, managed stream object that contains the stream of the user's profile picture
  • property uintptr_t PictureLocation
  • Forward facing address of the current user's profile picture in memory

####Private

  • int nextUserNumber
  • Used for traversing the users retrieved in an asynchronous call
  • Platform::String^ cylonName
  • private version of the CylonName property
  • Platform::String^ nonRoamableId
  • private version of the NonRoamableId property
  • Platform::Boolean infoReady
  • private version of the InfoReady property
  • Platform::Boolean infoCopied
  • private version of the InfoCopied property
  • **IRandomAccessStreamWithContentType^ pictureStream_
  • private version of the pictureStream property
  • uintptr_t pictureLocation
  • private version of the PictureLocation property

##Foster.cpp ###Gamepad State Tracking ####enum gamepadUpdatingState

  • STARTED
  • the code is ready to start tracking updates for controllerStructs
  • REMOVED
  • a controllerStruct has been removed, but at least one (possibly unresponsive) remains attached
  • ALL_REMOVED
  • all controllerStructs have been removed

####Tracking Properties

  • bool controllersPurged
  • flag raised when the controllers list and all associated superDevice structs in the detectedDevices list have been erased
  • uint32_t presentGamepadsAdded
  • the total amount of gamepads currently attached according to the Windows Gaming code, NOT The size of the controllers list
  • gamepadUpdatingState gamepadState
  • an instance of the above enum used to track the current state of controller tracking

Clone this wiki locally