70 {
"DDD_CORE0" , 0x20202020,
CORE ,
false },
71 {
"DDD_GTE0" , 0x30303030,
GTE ,
false },
81 {
"DDD_PCH0" , 0x40404040,
PCH ,
false },
82 {
"DDD_PMC0" , 0x50505050,
PMC ,
false },
118 uint32_t bitMask = 0x2;
123 for (
size_t index = 1; index < numNodes; ++index)
125 if ((bitMask & nodeSelectMask) != 0)
127 nodes[index].
Visible = makeVisible;
150 for (
size_t index = 0; index < numNodes; index++)
202 for (
size_t index = 0; index < numNodes; index++)
204 if (nodes[index].Visible)
208 printf(
" Error! Out of memory condition adding idcode to list of idcodes in DeviceChain_GetIdCodesForVisibleNodes()!\n");
243 bool IsLocked =
false;
266 bool unlocked =
false;
static void DeviceChain_GetIdCodesForVisibleNodes(int chainIndex, UIntArray *idcodes)
Retrieve a list of idcodes for all devices that are visible in the device chain.
static void DisableDevicesInDeviceChain(int chainIndex, uint32_t deviceselectMask)
Deselect one or more devices in the given device chain so those devices are no longer visible.
static bool LockDeviceChain(int chainIndex)
Lock the specified device chain to indicate exclusive access is desired.
static DeviceNode deviceChain0[]
Device Chain 0, with 3 devices. The first device is always the device controller, which is always vis...
static void ResetDeviceChain(int chainIndex)
Reset the visibility of all devices on the given device chain so that all devices except the first ar...
static void DeviceChain_ResetVisibility(int chainIndex)
Resets the specified device chain so that all devices that are not device controllers are no longer v...
static void GetIdcodes(int chainIndex, UIntArray *idcodes)
Retrieve a list of idcodes of all visible devices in the given device chain.
static bool UnlockDeviceChain(int chainIndex)
Unlock the specified device chain to indicate exclusive access is no longer desired.
static int deviceChainCount
Number of device chains that have been pre-defined.
static DeviceNode deviceChain1[]
Device Chain 1, with 3 devices. The first device is always the device controller, which is always vis...
static DeviceChain deviceChains[]
Device chains. There are two device chains, which are accessed separately. Each chain has its own loc...
IDeviceNetworkLowLevel * Facade_GetLowLevelDeviceService(void)
Retrieve a set of function pointers to the low-level device service used in the Facade Pattern exampl...
IDeviceNetworkLowLevel lowlevelService
Definition of the IDeviceNetworkLowLevel interface, using function pointers to each function.
static int GetNumChains(void)
Retrieve the number of device chains.
static void DeviceChain_DeselectNodes(int chainIndex, uint32_t nodeSelectMask)
Make invisible one or more devices in the device chain.
static void EnableDevicesInDeviceChain(int chainIndex, uint32_t deviceselectMask)
Select one or more devices in the given device chain so those devices are visible.
static void DeviceChain_SelectNodes(int chainIndex, uint32_t nodeSelectMask)
Make visible one or more devices in the device chain.
static void DeviceChain_ShowHideNodes(int chainIndex, uint32_t nodeSelectMask, bool makeVisible)
Helper function to show or hide devices on the device chain.
Declaration of the IDeviceNetworkLowLevel interface representing the complex system for the Facade Pa...
DeviceTypes
Identifies the type of devices that can appear in a device chain. Part of the Facade Pattern example.
@ DEVICECONTROLLER
device controller. This is always visible.
Declaration of the IDeviceNetworkHighLevel interface representing the high-level system used in the F...
Represents a single device chain, a collection of DeviceNode objects.
bool IsLocked
true if device chain is locked; otherwise, false
const char * Name
Name of device chain.
size_t numNodes
Number of nodes in the nodes field.
DeviceNode * nodes
List of nodes in this device chain.
Represents a single device. Part of the Facade Pattern example.
DeviceTypes DeviceType
A value from the DeviceTypes enumeration identifying the type of the device.
const char * Name
Name of this device.
bool Visible
Whether the device is visible in the device chain.
uint32_t Idcode
The idcode for this device.
Represents a network of device chains and the low level access to that network. In general,...
Represents an array of 32-bit unsigned integers. The data field points to a block of memory allocated...
bool UIntArray_AddInt(UIntArray *array, uint32_t value)
Add an unsigned 32-bit integer to the given UIntArray object.