Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 15:44, 23 June 2008.

Hardware Abstraction Layer

From Forum Nokia Wiki


Hardware Abstraction Layer: When developing applications for S60, there are APIs available to query the system capabilities, share state data with other applications and register for notification of changes to system states. These APIs are implemented in two main components:

  • The Hardware Abstraction Layer (HAL)
  • The System Agent Components


HAL provides a very simple to use APIs, which can query the attributes of the device, for example:

  • Manufacturer: manufacturer of the device, hardware and software version number.
  • Processor: processor architecture, ABI and processor speed.
  • Memory: total RAM, free RAM and total ROM.
  • Screen: screen dimension and display color.
  • Keyboard information.


The API itself is very small, with only three functions, all provided by the class HAL:


static TInt Get(TAttribute anAttribute, TInt& aValue);
static TInt Set(TAttribute anAttribute, TInt& aValue);
static TInt GetAll(TInt& aNumEntries, SEntry*& aData);


Some examples for getting the device attributes

1) Getting all the device attributes


TInt numHalEntries;
 
HAL::SEntry* halEntries;
 
HAL::GetAll(numHalEntries, halEntries);



2) Getting one specific attribute, in this case total RAM in bytes.


TInt ram;
 
HAL::Get(HAL::EMemoryRAM, ram);



Some examples for setting the device attributes

TInt err = HAL::Set(HAL::ECaseSwitchDisplayOn, 1);


If a field is not settable, then the return value from the call will be one of the standard system error codes, typically KErrNotSupported.


The class HAL (hal.h) derives from HALData (hal_data.h), which contains the definition of the enumeration TAttribute.

Header file: hal.h

Library: hal.lib  

Related Discussions
Thread Thread Starter Forum Replies Last Post
Supported BT hardware pingvishal Bluetooth Technology 0 2006-12-07 17:11
Architecture Question Tiger79 Mobile Java General 13 2007-04-25 21:33
How change font color in CAknIntegerEdwin? _Cool- Symbian User Interface 2 2008-03-07 07:58
2600 it is a disater bulbulov General Discussion 4 2005-04-23 13:14
Help Needed:WSP and concatenated message deepnc General Messaging 1 2005-12-02 10:21
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZhardwareQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX