Diffstat (limited to 'gammu/emb/common/phone/nokia/dct3/n7110.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/n7110.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gammu/emb/common/phone/nokia/dct3/n7110.c b/gammu/emb/common/phone/nokia/dct3/n7110.c index 5a02c9c..b597f9b 100644 --- a/gammu/emb/common/phone/nokia/dct3/n7110.c +++ b/gammu/emb/common/phone/nokia/dct3/n7110.c | |||
@@ -1,26 +1,29 @@ | |||
1 | /* (c) 2001-2004 by Marcin Wiacek */ | 1 | /* (c) 2001-2004 by Marcin Wiacek */ |
2 | /* based on some work from Markus Plail and Gnokii */ | 2 | /* based on some Markus Plail work from Gnokii (www.gnokii.org) |
3 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | ||
4 | * GNU GPL version 2 or later | ||
5 | */ | ||
3 | 6 | ||
4 | #include "../../../gsmstate.h" | 7 | #include "../../../gsmstate.h" |
5 | 8 | ||
6 | #ifdef GSM_ENABLE_NOKIA7110 | 9 | #ifdef GSM_ENABLE_NOKIA7110 |
7 | 10 | ||
8 | #include <string.h> | 11 | #include <string.h> |
9 | #include <time.h> | 12 | #include <time.h> |
10 | 13 | ||
11 | #include "../../../misc/coding/coding.h" | 14 | #include "../../../misc/coding/coding.h" |
12 | #include "../../../gsmcomon.h" | 15 | #include "../../../gsmcomon.h" |
13 | #include "../../../service/gsmlogo.h" | 16 | #include "../../../service/gsmlogo.h" |
14 | #include "../../pfunc.h" | 17 | #include "../../pfunc.h" |
15 | #include "../nfunc.h" | 18 | #include "../nfunc.h" |
16 | #include "../nfuncold.h" | 19 | #include "../nfuncold.h" |
17 | #include "n7110.h" | 20 | #include "n7110.h" |
18 | #include "dct3func.h" | 21 | #include "dct3func.h" |
19 | 22 | ||
20 | static GSM_Error N7110_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) | 23 | static GSM_Error N7110_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) |
21 | { | 24 | { |
22 | return DCT3_GetAlarm(s, alarm, 0x19); | 25 | return DCT3_GetAlarm(s, alarm, 0x19); |
23 | } | 26 | } |
24 | 27 | ||
25 | static GSM_Error N7110_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) | 28 | static GSM_Error N7110_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) |
26 | { | 29 | { |
@@ -505,48 +508,49 @@ static GSM_Error N7110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
505 | case 0x24: | 508 | case 0x24: |
506 | smprintf(s, "Invalid location. Too high ?\n"); | 509 | smprintf(s, "Invalid location. Too high ?\n"); |
507 | return ERR_INVALIDLOCATION; | 510 | return ERR_INVALIDLOCATION; |
508 | } | 511 | } |
509 | return ERR_UNKNOWNRESPONSE; | 512 | return ERR_UNKNOWNRESPONSE; |
510 | } | 513 | } |
511 | 514 | ||
512 | static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) | 515 | static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) |
513 | { | 516 | { |
514 | unsigned char req[] = {N7110_FRAME_HEADER, 0x22, 0x00, 0x00}; | 517 | unsigned char req[] = {N7110_FRAME_HEADER, 0x22, 0x00, 0x00}; |
515 | 518 | ||
516 | if (PhoneRingtone) return ERR_NOTSUPPORTED; | 519 | if (PhoneRingtone) return ERR_NOTSUPPORTED; |
517 | if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY; | 520 | if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY; |
518 | 521 | ||
519 | switch (Ringtone->Format) { | 522 | switch (Ringtone->Format) { |
520 | case RING_NOTETONE: | 523 | case RING_NOTETONE: |
521 | /* In the future get binary and convert */ | 524 | /* In the future get binary and convert */ |
522 | return ERR_NOTSUPPORTED; | 525 | return ERR_NOTSUPPORTED; |
523 | case RING_NOKIABINARY: | 526 | case RING_NOKIABINARY: |
524 | req[5]=N7110_ReturnBinaryRingtoneLocation(s->Phone.Data.Model)+Ringtone->Location; | 527 | req[5]=N7110_ReturnBinaryRingtoneLocation(s->Phone.Data.Model)+Ringtone->Location; |
525 | s->Phone.Data.Ringtone=Ringtone; | 528 | s->Phone.Data.Ringtone=Ringtone; |
526 | smprintf(s, "Getting binary ringtone\n"); | 529 | smprintf(s, "Getting binary ringtone\n"); |
527 | return GSM_WaitFor (s, req, 6, 0x1f, 4, ID_GetRingtone); | 530 | return GSM_WaitFor (s, req, 6, 0x1f, 4, ID_GetRingtone); |
528 | case RING_MIDI: | 531 | case RING_MIDI: |
532 | case RING_MMF: | ||
529 | return ERR_NOTSUPPORTED; | 533 | return ERR_NOTSUPPORTED; |
530 | } | 534 | } |
531 | return ERR_NOTSUPPORTED; | 535 | return ERR_NOTSUPPORTED; |
532 | } | 536 | } |
533 | 537 | ||
534 | static GSM_Error N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 538 | static GSM_Error N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
535 | { | 539 | { |
536 | int i; | 540 | int i; |
537 | GSM_Phone_N7110Data*Priv = &s->Phone.Data.Priv.N7110; | 541 | GSM_Phone_N7110Data*Priv = &s->Phone.Data.Priv.N7110; |
538 | 542 | ||
539 | smprintf(s, "Received info for Picture Images\n"); | 543 | smprintf(s, "Received info for Picture Images\n"); |
540 | smprintf(s, "Number : %i\n",msg.Buffer[4]*256+msg.Buffer[5]); | 544 | smprintf(s, "Number : %i\n",msg.Buffer[4]*256+msg.Buffer[5]); |
541 | smprintf(s, "Locations :"); | 545 | smprintf(s, "Locations :"); |
542 | Priv->LastPictureImageFolder.Number=msg.Buffer[4]*256+msg.Buffer[5]; | 546 | Priv->LastPictureImageFolder.Number=msg.Buffer[4]*256+msg.Buffer[5]; |
543 | for (i=0;i<Priv->LastPictureImageFolder.Number;i++) { | 547 | for (i=0;i<Priv->LastPictureImageFolder.Number;i++) { |
544 | Priv->LastPictureImageFolder.Location[i]=msg.Buffer[6+i*2]*256+msg.Buffer[7+i*2]; | 548 | Priv->LastPictureImageFolder.Location[i]=msg.Buffer[6+i*2]*256+msg.Buffer[7+i*2]; |
545 | smprintf(s, " %i",Priv->LastPictureImageFolder.Location[i]); | 549 | smprintf(s, " %i",Priv->LastPictureImageFolder.Location[i]); |
546 | } | 550 | } |
547 | smprintf(s, "\n"); | 551 | smprintf(s, "\n"); |
548 | return ERR_NONE; | 552 | return ERR_NONE; |
549 | } | 553 | } |
550 | 554 | ||
551 | static GSM_Error N7110_GetPictureImageLocation(GSM_StateMachine *s, GSM_Bitmap *Bitmap, unsigned char *folder, int *location) | 555 | static GSM_Error N7110_GetPictureImageLocation(GSM_StateMachine *s, GSM_Bitmap *Bitmap, unsigned char *folder, int *location) |
552 | { | 556 | { |
@@ -1626,48 +1630,49 @@ GSM_Phone_Functions N7110Phone = { | |||
1626 | N71_92_GetSignalQuality, | 1630 | N71_92_GetSignalQuality, |
1627 | DCT3_GetNetworkInfo, | 1631 | DCT3_GetNetworkInfo, |
1628 | NOTSUPPORTED, /* GetCategory */ | 1632 | NOTSUPPORTED, /* GetCategory */ |
1629 | NOTSUPPORTED, /* AddCategory */ | 1633 | NOTSUPPORTED, /* AddCategory */ |
1630 | NOTSUPPORTED, /* GetCategoryStatus */ | 1634 | NOTSUPPORTED, /* GetCategoryStatus */ |
1631 | N7110_GetMemoryStatus, | 1635 | N7110_GetMemoryStatus, |
1632 | N7110_GetMemory, | 1636 | N7110_GetMemory, |
1633 | NOTIMPLEMENTED, /* GetNextMemory */ | 1637 | NOTIMPLEMENTED, /* GetNextMemory */ |
1634 | N7110_SetMemory, | 1638 | N7110_SetMemory, |
1635 | NOTIMPLEMENTED, /* AddMemory */ | 1639 | NOTIMPLEMENTED, /* AddMemory */ |
1636 | N7110_DeleteMemory, | 1640 | N7110_DeleteMemory, |
1637 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 1641 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
1638 | N7110_GetSpeedDial, | 1642 | N7110_GetSpeedDial, |
1639 | NOTIMPLEMENTED, /* SetSpeedDial */ | 1643 | NOTIMPLEMENTED, /* SetSpeedDial */ |
1640 | DCT3_GetSMSC, | 1644 | DCT3_GetSMSC, |
1641 | DCT3_SetSMSC, | 1645 | DCT3_SetSMSC, |
1642 | N7110_GetSMSStatus, | 1646 | N7110_GetSMSStatus, |
1643 | N7110_GetSMSMessage, | 1647 | N7110_GetSMSMessage, |
1644 | N7110_GetNextSMSMessage, | 1648 | N7110_GetNextSMSMessage, |
1645 | N7110_SetSMS, | 1649 | N7110_SetSMS, |
1646 | N7110_AddSMS, | 1650 | N7110_AddSMS, |
1647 | N7110_DeleteSMS, | 1651 | N7110_DeleteSMS, |
1648 | DCT3_SendSMSMessage, | 1652 | DCT3_SendSMSMessage, |
1649 | NOTSUPPORTED, /* SendSavedSMS */ | 1653 | NOTSUPPORTED, /* SendSavedSMS */ |
1654 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
1650 | N7110_SetIncomingSMS, | 1655 | N7110_SetIncomingSMS, |
1651 | DCT3_SetIncomingCB, | 1656 | DCT3_SetIncomingCB, |
1652 | N7110_GetSMSFolders, | 1657 | N7110_GetSMSFolders, |
1653 | NOTIMPLEMENTED, /* AddSMSFolder */ | 1658 | NOTIMPLEMENTED, /* AddSMSFolder */ |
1654 | NOTIMPLEMENTED, /* DeleteSMSFolder */ | 1659 | NOTIMPLEMENTED, /* DeleteSMSFolder */ |
1655 | DCT3_DialVoice, | 1660 | DCT3_DialVoice, |
1656 | N7110_AnswerCall, | 1661 | N7110_AnswerCall, |
1657 | DCT3_CancelCall, | 1662 | DCT3_CancelCall, |
1658 | NOTIMPLEMENTED, /* HoldCall */ | 1663 | NOTIMPLEMENTED, /* HoldCall */ |
1659 | NOTIMPLEMENTED, /* UnholdCall */ | 1664 | NOTIMPLEMENTED, /* UnholdCall */ |
1660 | NOTIMPLEMENTED, /* ConferenceCall */ | 1665 | NOTIMPLEMENTED, /* ConferenceCall */ |
1661 | NOTIMPLEMENTED, /* SplitCall */ | 1666 | NOTIMPLEMENTED, /* SplitCall */ |
1662 | NOTIMPLEMENTED, /* TransferCall */ | 1667 | NOTIMPLEMENTED, /* TransferCall */ |
1663 | NOTIMPLEMENTED, /* SwitchCall */ | 1668 | NOTIMPLEMENTED, /* SwitchCall */ |
1664 | NOTSUPPORTED, /* GetCallDivert */ | 1669 | NOTSUPPORTED, /* GetCallDivert */ |
1665 | N7110_SetCallDivert, | 1670 | N7110_SetCallDivert, |
1666 | N7110_CancelAllDiverts, | 1671 | N7110_CancelAllDiverts, |
1667 | N7110_SetIncomingCall, | 1672 | N7110_SetIncomingCall, |
1668 | N7110_SetIncomingUSSD, | 1673 | N7110_SetIncomingUSSD, |
1669 | DCT3DCT4_SendDTMF, | 1674 | DCT3DCT4_SendDTMF, |
1670 | N7110_GetRingtone, | 1675 | N7110_GetRingtone, |
1671 | N7110_SetRingtone, | 1676 | N7110_SetRingtone, |
1672 | NOTSUPPORTED, /* GetRingtonesInfo*/ | 1677 | NOTSUPPORTED, /* GetRingtonesInfo*/ |
1673 | NOTSUPPORTED, /* DeleteUserRingtones*/ | 1678 | NOTSUPPORTED, /* DeleteUserRingtones*/ |
@@ -1680,45 +1685,45 @@ GSM_Phone_Functions N7110Phone = { | |||
1680 | NOTSUPPORTED, /* GetMMSSettings */ | 1685 | NOTSUPPORTED, /* GetMMSSettings */ |
1681 | NOTSUPPORTED, /* SetMMSSettings */ | 1686 | NOTSUPPORTED, /* SetMMSSettings */ |
1682 | NOTSUPPORTED, /* GetSyncMLSettings*/ | 1687 | NOTSUPPORTED, /* GetSyncMLSettings*/ |
1683 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 1688 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
1684 | NOTSUPPORTED, /* GetChatSettings */ | 1689 | NOTSUPPORTED, /* GetChatSettings */ |
1685 | NOTSUPPORTED, /* SetChatSettings */ | 1690 | NOTSUPPORTED, /* SetChatSettings */ |
1686 | N7110_GetBitmap, | 1691 | N7110_GetBitmap, |
1687 | N7110_SetBitmap, | 1692 | N7110_SetBitmap, |
1688 | NOTSUPPORTED, /* GetToDoStatus */ | 1693 | NOTSUPPORTED, /* GetToDoStatus */ |
1689 | NOTSUPPORTED, /* GetToDo */ | 1694 | NOTSUPPORTED, /* GetToDo */ |
1690 | NOTSUPPORTED, /* GetNextToDo */ | 1695 | NOTSUPPORTED, /* GetNextToDo */ |
1691 | NOTSUPPORTED, /* SetToDo */ | 1696 | NOTSUPPORTED, /* SetToDo */ |
1692 | NOTSUPPORTED, /* AddToDo */ | 1697 | NOTSUPPORTED, /* AddToDo */ |
1693 | NOTSUPPORTED, /* DeleteToDo */ | 1698 | NOTSUPPORTED, /* DeleteToDo */ |
1694 | NOTSUPPORTED, /* DeleteAllToDo */ | 1699 | NOTSUPPORTED, /* DeleteAllToDo */ |
1695 | N7110_GetCalendarStatus, | 1700 | N7110_GetCalendarStatus, |
1696 | NOTIMPLEMENTED, /* GetCalendar */ | 1701 | NOTIMPLEMENTED, /* GetCalendar */ |
1697 | N7110_GetNextCalendar, | 1702 | N7110_GetNextCalendar, |
1698 | NOTIMPLEMENTED, /* SetCalendar */ | 1703 | NOTIMPLEMENTED, /* SetCalendar */ |
1699 | N7110_AddCalendar, | 1704 | N7110_AddCalendar, |
1700 | N71_65_DelCalendar, | 1705 | N71_65_DelCalendar, |
1701 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ | 1706 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ |
1702 | NOTSUPPORTED, /* GetCalendarSettings*/ | 1707 | NOTSUPPORTED, /* GetCalendarSettings*/ |
1703 | NOTSUPPORTED, /* SetCalendarSettings*/ | 1708 | NOTSUPPORTED, /* SetCalendarSettings*/ |
1704 | NOTSUPPORTED, /* GetNote */ | 1709 | NOTSUPPORTED, /* GetNextNote */ |
1705 | N7110_GetProfile, | 1710 | N7110_GetProfile, |
1706 | N7110_SetProfile, | 1711 | N7110_SetProfile, |
1707 | NOTSUPPORTED, /* GetFMStation */ | 1712 | NOTSUPPORTED, /* GetFMStation */ |
1708 | NOTSUPPORTED, /* SetFMStation */ | 1713 | NOTSUPPORTED, /* SetFMStation */ |
1709 | NOTSUPPORTED, /* ClearFMStations */ | 1714 | NOTSUPPORTED, /* ClearFMStations */ |
1710 | NOTSUPPORTED, /* GetNextFileFolder*/ | 1715 | NOTSUPPORTED, /* GetNextFileFolder*/ |
1711 | NOTSUPPORTED, /* GetFilePart */ | 1716 | NOTSUPPORTED, /* GetFilePart */ |
1712 | NOTSUPPORTED, /* AddFile */ | 1717 | NOTSUPPORTED, /* AddFile */ |
1713 | NOTSUPPORTED, /* GetFileSystemStatus*/ | 1718 | NOTSUPPORTED, /* GetFileSystemStatus*/ |
1714 | NOTSUPPORTED, /* DeleteFile */ | 1719 | NOTSUPPORTED, /* DeleteFile */ |
1715 | NOTSUPPORTED, /* AddFolder */ | 1720 | NOTSUPPORTED, /* AddFolder */ |
1716 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ | 1721 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ |
1717 | NOTSUPPORTED /* SetGPRSAccessPoint*/ | 1722 | NOTSUPPORTED /* SetGPRSAccessPoint*/ |
1718 | }; | 1723 | }; |
1719 | 1724 | ||
1720 | #endif | 1725 | #endif |
1721 | 1726 | ||
1722 | /* How should editor hadle tabs in this file? Add editor commands here. | 1727 | /* How should editor hadle tabs in this file? Add editor commands here. |
1723 | * vim: noexpandtab sw=8 ts=8 sts=8: | 1728 | * vim: noexpandtab sw=8 ts=8 sts=8: |
1724 | */ | 1729 | */ |