Programming and integration of eHouse smart home in C , C ++ , Object C for different platforms soft&hardware
Smart Home eHouse building management .
Programming in C , C ++ , Object C allows the integration of eHouse smart home with almost any hardware and operating systems.
It is one of the most low-level programming languages.
Thanks to this, software written in any variants of C is :
- The fastest available (except Assembler – direct machine commands for the processor)
- Least utilization of system microprocessor ( CPU )
- has the smallest demand for efficiency,memory, speed of hosting processor
- allows easy adaptation to any operating system (in fact, every system has a C compiler) for creating software for any platform
- can run on any hardware equipped with a processor : PC , micro and mini computers , board computer , microprocessor controllers and microcontrollers
To facilitate the integration of smart eHouse home controllers individual software created by end users, Merchants , cooperating companies – we present application templates for creating software in C , C ++ , Object C .
This gives you the ability to create software on any operating system even very exotic :
- Amiga ( AmigaOS , AROS , MorphOS )
- Apple ( iOS , Mac OS , Apple DOS , ProDOS , Darwin , GS / OS , OS X , OS X Server)
- Atari ST ( Atari TOS , MultiTOS , FreeMiNT , MagiC )
- Be ( BeOS , BeIa , NewOS / Haiku , YellowTAB , Zeta)
- DEC / Compaq ( AIS , OS – 8 , RSTS / E , RSX , RT – 11 , TOPS , VMS / OpenVMS )
- Google (Android , Chrome OS )
- IBM (OS / 2 , AIX , OS / 400 , OS / 390 , VM / CMS , DOS / VSE , DOS / 360 , OS / 360 , MFT , MVT , PC – DOS , SVS , MVS , TPF , ALCS , z / OS)
- ICL ( EXEC , JEAN , MINIMOP , GEORGE , Kozber manul )
- Microsoft (MS-DOS , PC-DOS , DR-DOS , FreeDOS , DOS , QDOS , Microsoft Windows: 1.0 , 2.0 , 3.x , 95/98 / Me , CE and Mobile , NT/2000/XP/ 2003 / FLP / Vista / 2008/ 7/8 , Petros , ReactOS )
- Novell (Novell NetWare , Novell DOS)
- NeXT / NeXTStep
- Unisys ( MCP ( Master Control Program) , OS 2200 )
- UNIX (AIX , Android , BSD , FreeBSD , NetBSD , OpenBSD , DragonFly BSD , DesktopBSD , PC – BSD , examines , Darwin , Digital UNIX , HP – UX , iOS )
- IRIX , OS X , Minix , OSF / 1 , SCO UNIX , Oracle Solaris (formerly Sun Solaris , SunOS ) , Oracle OpenSolaris , OpenIndiana , Unix Version 7 , QNX , Ultrix , Venix , Xenix , GNU / Linux , GNU / Hurd , Linux , Palm webOS
- Real Time OS ( LynxOS , FlexOS , OS9 , Phoenix – RTOS , QNX , Nut / OS , RT – Linux , VxWorks , Suse Linux Enterprise Real Time , MicroC / OS – II)
- Other ( Agnix , Amoeba , AtariDOS , AtheOS / Syllable , Athene , Azure Operating System , Commodore DOS (saved in drive ) , Contiki , CP / J , CP / M , CROOK , eComStation , Executor RTX , EMOS , EPOC32 , GEM , GEOS , Inferno , IOS , iRMX , ISIS – II , Kylin , MenuetOS , Mikros , Multics , Palm OS , Quarna OS , SkyOS , Symbian , Udos , Unununium , The V7)
This applies to any hardware , microprocessors or microcontrollers even 8 – bit , 16 , 32-bit .
The basic structure of a template for creating software drivers are structures containing statuses for each type of eHouse controller depending on the type of architecture
- RS – 485 ( Serial bus industries )
- Ethernet (LAN)
- CAN ( Controller Area Network)
- eHouse.PRO (centralized Version)
and the type of controller such as:
- RoomManager
- EthernetRoomManager
- HeatManager
- ExternalManager
- CommManager
- LevelManager
Regardless of the transmission medium and protocol :
- RS – 485 ” Uart ” eHouse 1
- TCP / IP – Ethernet eHouse , eHouse4Can
- UDP – Ethernet eHouse , eHouse4Can
- Other transmission media
They allow direct reception of a frame containing the status of the controller type and loading it into a data structure for the driver – Direct copying of the memory buffer without decoding information .
Structures can automatically decode the received transmission frame and assignment to variables including structure variables bit .
Definition of Union containing the structure of individual controllers allows you to copy the received frame buffer memory and loaded into the union element “date” . Write the frame to the structure is immediate, and when reading the elements by fields of the structure occurs “automatic decoding ” the information contained in the structure. Note : Defined unions containing state drivers eHouse1 require copy the shift (offset) :
1 – for the normal address , frame: { size } [ ehouse1status structure ]
3 – for the extended address ( when sending the address of your controller) , frame: { size } { } { This addrh this AdrL } [ ehouse1status structure ] – The structure has the form : { AddrH } { } { AddrL ‘ ‘ s ‘ ‘ } [Data . . . . . . . . . . . . . . . . . ]
where AddrH – address – MSB
AddrL – address – LSB
‘s’ – letter s indicating the STATUS as the type of data Smart House eHouse – programming C structure for eHouse One controllers
The structures are a common part for any application for any microprocessor or operating system .
reception status , latter processing, data Acquisition, display requires creating individual software for a given hardware platform and a software .
Union fields is separated with “.” character . if you do not have to deal with the pointer or “->” for a pointer. Eg . “HM.AddrH” or * ( HM->AddrH)
Software Description – integrating the system eHouse with external software and hardware :
- Write the function of receiving frame status for individual hardware and limitations Software
- Create an array of instances of the union of size total amounts of hardware eHouse 1 controllers: RMeHouse1Status rms [ COUNT_OF_RMS ] ; // For RM amount = COUNT_OF_RMS PC can be up to 250
// for a different type of device the minimum amount in order not to utilze the system, such as a few pieces more than the number of drivers HMeHouse1Status HM ; /// One instance HeatManager is in the system - initialize all the elements of the union RMS[i].AddrH = 55 ; and RMS [i].AddrL = %x% addresses the values of installed drivers RoomManager
- if you have HeatManager initiate ” HM . AddrH = 1 ; ” and ” HM . AddrL = 1 ; ” – It is a fixed address HeatManager
- when receiving frame status via any transmission media and compare field AddrH:AddrL current frame and copy to an instance of union with the same address such as memcpy function according to the algorithm
for ( k = 0 ; k <sizeof (RMs[i]);k++) RMs[i].data[k]:=ReceivedBuffer[k+offset];
for example, depending on the definition of the function for the compiler memcopy and the system: memcpy (* RMS [i ], & data , * ( ReceivedBuffer + offset ) , sizeof (RMS [i ] ) ) where ” and ” RoomManager is an index of the relative address according to the received frame) - At this point, we get the template application on any system containing in the structure of the controller decoded the latest status for each controller
- Based on these data , we can create online these communication goals , log analyzers , Advanced processing applications automation algorithms depend on many factors
Application template is so simple and efficient that using the 8-bit microcontroller can process this data in real time .
example illustrating the use of an advanced algorithm statuses union with the automatic loading of data:
if ((RMS [0].OUT.o1) // if output 1 RM [ 0 ] IS ON
if (RMS[1].INPUTS.i7) // and if input 7 RM [1] on
if (!RMS [2].INPUTS.i3) // and if input 3 RM [2 ] off
if (! RMS [11] . OUT . o7 ) // and if the output 7 RM [11 ] off
if(RMS [1 ] . ADC . an1 <255 ) // and if the measured value analog-digital converter an1 requires the conversion of the
sendEvent ( ” 5507210d010000000000 ” ) ; // start – send events ” direct event ” in hex code
// hhlleea1a2a3a4a5a6a7
// where
// hh – AddrH
// ll – AddrL
// ee – Event Code (command )
// a1 . . a7 – (arguments for command) }