mbus-6160.h

上传用户:susan2053
上传日期:2007-01-07
资源大小:731k
文件大小:5k
源码类别:手机短信编程
开发平台:Unix_Linux
  1. /*
  2.   G N O K I I
  3.   A Linux/Unix toolset and driver for Nokia mobile phones.
  4.   Copyright (C) 1999, 2000 Hugh Blemings & Pavel Jan韐 ml.
  5.   Released under the terms of the GNU GPL, see file COPYING for more details.
  6.   Header file for 6160 code.
  7.   Last modification: Fri May 19 15:31:26 EST 2000
  8.   Modified by Hugh Blemings <hugh@linuxcare.com>
  9. */
  10. #ifndef __mbus_6160_h
  11. #define __mbus_6160_h
  12. #ifndef __gsm_common_h
  13. #include "gsm-common.h" /* Needed for GSM_Error etc. */
  14. #endif
  15. /* Global variables */
  16. extern bool MB61_LinkOK;
  17. extern GSM_Functions MB61_Functions;
  18. extern GSM_Information MB61_Information;
  19. /* Prototypes for the functions designed to be used externally. */
  20. GSM_Error   MB61_Initialise(char *port_device, char *initlength,
  21.                             GSM_ConnectionType connection,
  22.                             void (*rlp_callback)(RLP_F96Frame *frame));
  23. bool MB61_OpenSerial(void);
  24. void MB61_Terminate(void);
  25. int MB61_GetMemoryType(GSM_MemoryType memory_type);
  26. GSM_Error MB61_GetMemoryLocation(GSM_PhonebookEntry *entry);
  27. GSM_Error MB61_WritePhonebookLocation(GSM_PhonebookEntry *entry);
  28. GSM_Error MB61_GetSpeedDial(GSM_SpeedDial *entry);
  29. GSM_Error MB61_SetSpeedDial(GSM_SpeedDial *entry);
  30. GSM_Error MB61_GetMemoryStatus(GSM_MemoryStatus *Status);
  31. GSM_Error MB61_GetSMSStatus(GSM_SMSStatus *Status);
  32. GSM_Error       MB61_GetSMSCenter(GSM_MessageCenter *MessageCenter);
  33. GSM_Error MB61_GetSMSMessage(GSM_SMSMessage *message);
  34. GSM_Error MB61_GetSMSCenter(GSM_MessageCenter *MessageCenter);
  35. GSM_Error MB61_SetSMSCenter(GSM_MessageCenter *MessageCenter);
  36. GSM_Error MB61_DeleteSMSMessage(GSM_SMSMessage *message);
  37. GSM_Error MB61_SendSMSMessage(GSM_SMSMessage *SMS, int size);
  38. GSM_Error MB61_GetRFLevel(GSM_RFUnits *units, float *level);
  39. GSM_Error MB61_GetBatteryLevel(GSM_BatteryUnits *units, float *level);
  40. /* These aren't presently implemented. */
  41. GSM_Error MB61_GetPowerSource(GSM_PowerSource *source);
  42. GSM_Error MB61_GetDisplayStatus(int *Status);
  43. GSM_Error MB61_EnterSecurityCode(GSM_SecurityCode SecurityCode);
  44. GSM_Error MB61_GetSecurityCodeStatus(int *Status);
  45. GSM_Error MB61_GetIMEI(char *imei);
  46. GSM_Error MB61_GetRevision(char *revision);
  47. GSM_Error MB61_GetModel(char *model);
  48. GSM_Error MB61_GetDateTime(GSM_DateTime *date_time);
  49. GSM_Error MB61_SetDateTime(GSM_DateTime *date_time);
  50. GSM_Error MB61_GetAlarm(int alarm_number, GSM_DateTime *date_time);
  51. GSM_Error MB61_SetAlarm(int alarm_number, GSM_DateTime *date_time);
  52. GSM_Error MB61_DialVoice(char *Number);
  53. GSM_Error MB61_DialData(char *Number, char type,  void (* callpassup)(char c));
  54. GSM_Error MB61_GetIncomingCallNr(char *Number);
  55. GSM_Error MB61_GetNetworkInfo(GSM_NetworkInfo *NetworkInfo);
  56. GSM_Error MB61_GetCalendarNote(GSM_CalendarNote *CalendarNote);
  57. GSM_Error MB61_WriteCalendarNote(GSM_CalendarNote *CalendarNote);
  58. GSM_Error MB61_DeleteCalendarNote(GSM_CalendarNote *CalendarNote);
  59. GSM_Error MB61_Netmonitor(unsigned char mode, char *Screen);
  60. GSM_Error MB61_SendDTMF(char *String);
  61. GSM_Error MB61_GetBitmap(GSM_Bitmap *Bitmap);
  62. GSM_Error MB61_SetBitmap(GSM_Bitmap *Bitmap);
  63. GSM_Error MB61_Reset(unsigned char type);
  64. GSM_Error MB61_GetProfile(GSM_Profile *Profile);
  65. GSM_Error MB61_SetProfile(GSM_Profile *Profile);
  66. bool   MB61_SendRLPFrame(RLP_F96Frame *frame, bool out_dtx);
  67. GSM_Error MB61_CancelCall(void);
  68. /* All defines and prototypes from here down are specific to 
  69.    this model and so are #ifdef out if __mbus_6160_c isn't 
  70.    defined. */
  71. #ifdef __mbus_6160_c
  72. #define MB61_MAX_RECEIVE_LENGTH (160)
  73. #define  MB61_MAX_TRANSMIT_LENGTH (200) /* Arbitrary */
  74. #define MSG_ADDR_PC (0x1d)
  75. #define MSG_ADDR_PHONE (0x00)
  76. #define MSG_ADDR_SERVICE (0x10)
  77. #define MSG_ADDR_UNKNOWN (0xf8)
  78. #define MSG_ADDR_GLOBAL (0xff)
  79.     /* States for receive code. */
  80. enum    MB61_RX_States {MB61_RX_Sync,
  81.                         MB61_RX_GetDestination,
  82.                         MB61_RX_GetSource,
  83.                         MB61_RX_GetCommand,
  84.                         MB61_RX_GetLengthMSB,
  85.                         MB61_RX_GetLengthLSB,
  86.                         MB61_RX_GetMessage,
  87.                         MB61_RX_GetCSum};
  88. /* Prototypes for internal functions. */
  89. void MB61_ThreadLoop(void);
  90. void    MB61_SigHandler(int status);
  91. void    MB61_ThreadLoop(void);
  92. void MB61_UpdateSequenceNumber(void);
  93. int     MB61_TX_SendMessage(u8 destination, u8 source, u8 command, u8 sequence_byte, int message_length, u8 *buffer);
  94. void MB61_TX_SendPhoneIDRequest(void);
  95. void    MB61_RX_StateMachine(char rx_byte);
  96. enum    MB61_RX_States MB61_RX_DispatchMessage(void);
  97. void    MB61_RX_DisplayMessage(void);
  98. #endif /* __mbus_6160_c */
  99. #endif /* __mbus_6160_h */