| 1 |
#include <e32std.h> |
| 2 |
#include <e32hal.h> |
| 3 |
#include <d32snd.h> |
| 4 |
#include <stdio.h> |
| 5 |
#include <string.h> |
| 6 |
|
| 7 |
#include "utsname.h" |
| 8 |
|
| 9 |
extern "C" |
| 10 |
{ |
| 11 |
int epoc32_uname(struct regina_utsname *name) |
| 12 |
{ |
| 13 |
TMachineInfoV1Buf machine; |
| 14 |
UserHal::MachineInfo (machine); |
| 15 |
|
| 16 |
memcpy( (char *)name->sysname, (char *)machine().iProcessorName.Ptr(), machine().iProcessorName.Length() ); |
| 17 |
name->sysname[machine().iProcessorName.Length()] = '\0'; |
| 18 |
sprintf( name->version,"%d.%d",machine ().iRomVersion.iMajor, machine ().iRomVersion.iMinor ); |
| 19 |
sprintf( name->release,"%d",machine ().iRomVersion.iBuild ); |
| 20 |
memcpy( (char *)name->nodename, (char *)machine().iPsuName.Ptr(), machine().iPsuName.Length() ); |
| 21 |
name->nodename[machine().iPsuName.Length()] = '\0'; |
| 22 |
memcpy( (char *)name->machine, (char *)machine().iMachineName.Ptr(), machine().iMachineName.Length() ); |
| 23 |
name->machine[machine().iMachineName.Length()] = '\0'; |
| 24 |
|
| 25 |
return 0; |
| 26 |
} |
| 27 |
void beep( int freq, int dur ) |
| 28 |
{ |
| 29 |
RDevSound snd; |
| 30 |
TInt ret; |
| 31 |
TRequestStatus status; |
| 32 |
TSoundConfig config; |
| 33 |
|
| 34 |
ret = snd.Open(); |
| 35 |
config().iVolume = EVolumeMedium; |
| 36 |
snd.SetConfig( config ); |
| 37 |
snd.PlaySineWave( status, freq, EVolumeMedium, dur ); |
| 38 |
User::WaitForRequest( status ); |
| 39 |
snd.Close(); |
| 40 |
} |
| 41 |
|
| 42 |
} |