Avatar

国庆,旅游等等杂事让我荒废了接近3个月,现在还是要重新开始努力了,不管结局如何。

GSM0408RR部分阅读的选取部分
Two service access points are defined on signalling layer 2 which are discriminated by their Service
Access Point Identifiers (SAPI) (see GSM 04.06):
i) SAPI 0: supports the transfer of signalling information including user-user information;
ii) SAPI 3: supports the transfer of user short messages.

The general purpose of Radio Resource procedures is to establish, maintain and release RR connections
that allow a point-to-point dialogue between the network and a mobile station. This includes the cell
selection/reselection and the handover procedures. Moreover, Radio Resource management procedures
include the reception of the uni-directional BCCH and CCCH when no RR connection is established. This
permits automatic cell selection/reselection.
A RR connection is a physical connection used by the two peer entities to support the upper layers’
exchange of information flows.

In idle mode no RR connection exists.
In Idle mode, upper layers can require the establishment of an RR connection

In dedicated mode, the RR connection is a physical point-to-point bi-directional connection, and includes a
SAPI 0 data link connection operating in multiframe mode on the main DCCH. If dedicated mode is
established, RR procedures provide the following services:
- establishment/release of multiframe mode on data link layer connections other than SAPI 0, on the
main DCCH or on the SACCH associated with the channel carrying the main signalling link;
- transfer of messages on any data link layer connection;
- indication of temporary unavailability of transmission (suspension, resuming);
- indication of loss of RR connection;
- automatic cell reselection and handover to maintain the RR connection;
Page 34
Draft prETS 300 940 (GSM 04.08 Part A version 5.7.0): October 1997
- setting/change of the transmission mode on the physical channels, including change of type of
channel, change of the coding/decoding/transcoding mode and setting of ciphering;
- allocation/release of an additional channel (for the TCH/H + TCH/H configuration);
- allocation/release of additional channels for multislot operation;
- release of an RR connection.

In case a change of dedicated channels is required using a dedicated assignment and handover
procedure, respectively, the RR sublayer will request the data link layer to suspend multiple frame
operation before the mobile station leaves the old channel. When the channel change has been
completed, layer 3 will request the data link layer to resume multiple frame operation again.

For SAPIs other than 0, the data link procedures described in GSM 04.06 do not provide any guarantee
against message loss or duplication.

Tagged with: , .
Avatar

具体请看附件..

errornumber

类似

(0, “S_OK”, “The function completed successfully”)
(0×1, “S_FALSE”, “Call successful, but returned FALSE”)
(0×2, “DXERROR_FILE_NOT_FOUND”, “The system cannot find the file specified.”)
(0×3, “DXERROR_PATH_NOT_FOUND”, “The system cannot find the path specified.”)
(0×4, “DXERROR_TOO_MANY_OPEN_FILES”, “The system cannot open the file.”)
(0×5, “DXERROR_ACCESS_DENIED”, “Access is denied.”)
(0×6, “DXERROR_INVALID_HANDLE”, “The handle is invalid.”)
(0×8, “DXERROR_NOT_ENOUGH_MEMORY”, “Not enough storage is available to process this command.”)
(0×9, “DXERROR_INVALID_BLOCK”, “The storage control block address is invalid.”)
(0xa, “DXERROR_BAD_ENVIRONMENT”, “The environment is incorrect.”)
(0xb, “DXERROR_BAD_FORMAT”, “An attempt was made to load a program with an incorrect format.”)
(0xe, “DXERROR_OUTOFMEMORY”, “The system cannot find the drive specified.”)
(0×40003, “Unknown”, “End of stream. Sample not updated.”)
(0×40103, “VFW_S_NO_MORE_ITEMS”, “The end of the list has been reached.”)
(0×4022d, “VFW_S_DUPLICATE_NAME”, “An attempt to add a filter with a duplicate name succeeded with a modified name.”)
(0×40237, “VFW_S_STATE_INTERMEDIATE”, “The state transition has not completed.”)
(0×40242, “VFW_S_PARTIAL_RENDER”, “Some of the streams in this movie are in an unsupported format.”)
(0×40245, “VFW_S_SOME_DATA_IGNORED”, “The file contained some property settings that were not used.”)
(0×40246, “VFW_S_CONNECTIONS_DEFERRED”, “Some connections have failed and have been deferred.”)
(0×40250, “VFW_S_RESOURCE_NOT_NEEDED”, “The resource specified is no longer needed.”)
(0×40254, “VFW_S_MEDIA_TYPE_IGNORED”, “A connection could not be made with the media type in the persistent graph, but has been made with a negotiated media type.”)
(0×40257, “VFW_S_VIDEO_NOT_RENDERED”, “Cannot play back the video stream: no suitable decompressor could be found.”)
(0×40258, “VFW_S_AUDIO_NOT_RENDERED”, “Cannot play back the audio stream: no audio hardware is available.”)
(0×4025a, “VFW_S_RPZA”, “Cannot play back the video stream: format ‘RPZA’ is not supported.”)
(0×40260, “VFW_S_ESTIMATED”, “The value returned had to be estimated.  It’s accuracy can not be guaranteed.”)
(0×40263, “VFW_S_RESERVED”, “This success code is reserved for internal purposes within ActiveMovie.”)
(0×40267, “VFW_S_STREAM_OFF”, “The stream has been turned off.”)
(0×40268, “VFW_S_CANT_CUE”, “The graph can’t be cued because of lack of or corrupt data.”)
(0×40270, “VFW_S_NO_STOP_TIME”, “The stop time for the sample was not set.”)
(0×4027e, “VFW_S_NOPREVIEWPIN”, “There was no preview pin available, so the capture pin output is being split to provide both capture and preview.”)
(0×40280, “VFW_S_DVD_NON_ONE_SEQUENTIAL”, “The current title was not a sequential set of chapters (PGC) and the returned timing information might not be continuous.”)
(0×4028c, “VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE”, “The audio stream did not contain sufficient information to determine the contents of each channel.”)
(0×4028d, “VFW_S_DVD_NOT_ACCURATE”, “The seek into the movie was not frame accurate.”)
(0×150005, “DV_FULLDUPLEX”, “Full duplex”)
(0×15000a, “DV_HALFDUPLEX”, “Half duplex”)
(0×150010, “DV_PENDING”, “Pending”)
(0×876086f, “D3DOK_NOAUTOGEN”, “The call succeeded but there won’t be any mipmaps generated”)
(0×878000a, “DS_NO_VIRTUALIZATION”, “The call succeeded, but we had to substitute the 3D algorithm”)
DXERROR8(0×8780014, “DS_INCOMPLETE”, “The call succeeded, but not all of the optional effects were obtained.”)
(0×8781091, “DMUS_S_PARTIALLOAD”, “The object could only load partially. This can happen if some components are not registered properly, such as embedded tracks and tools. This can also happen if some content is missing. For example, if a segment uses a DLS collection that is not in the loader’s current search directory.”)
(0×8781092, “DMUS_S_PARTIALDOWNLOAD”, “Return value from IDirectMusicBand::Download() which indicates that some of the instruments safely downloaded, but others failed. This usually occurs when some instruments are on PChannels not supported by the performance or port.”)
(0×8781200, “DMUS_S_REQUEUE”, “Return value from IDirectMusicTool::ProcessPMsg() which indicates to the performance that it should cue the PMsg again automatically.”)
(0×8781201, “DMUS_S_FREE”, “Return value from IDirectMusicTool::ProcessPMsg() which indicates to the performance that it should free the PMsg automatically.”)
(0×8781202, “DMUS_S_END”, “Return value from IDirectMusicTrack::Play() which indicates to the segment that the track has no more data after mtEnd.”)
(0×8781210, “DMUS_S_STRING_TRUNCATED”, “Returned string has been truncated to fit the buffer size.”)
(0×8781211, “DMUS_S_LAST_TOOL”, “Returned from IDirectMusicGraph::StampPMsg() this indicates that the PMsg is already stamped with the last tool in the graph. The returned PMsg’s tool pointer is now NULL.”)
(0×8781212, “DMUS_S_OVER_CHORD”, “Returned from IDirectMusicPerformance::MusicToMIDI() this indicates  that no note has been calculated because the music value has the note  at a position higher than the top note of the chord. This applies only to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates that the caller should not do anything with the note. It is not meant to be played against this chord.”)
(0×8781213, “DMUS_S_UP_OCTAVE”, “Returned from IDirectMusicPerformance::MIDIToMusic()  and IDirectMusicPerformance::MusicToMIDI() this indicates  that the note conversion generated a note value that is below 0,  so it has been bumped up one or more octaves to be in the proper MIDI range of 0 through 127.  Note that this is valid for MIDIToMusic() when using play modes DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of which store MIDI values in wMusicValue. With MusicToMIDI() it is valid for all play modes. Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.”)
(0×8781214, “DMUS_S_DOWN_OCTAVE”, “Returned from IDirectMusicPerformance::MIDIToMusic()  and IDirectMusicPerformance::MusicToMIDI() this indicates  that the note conversion generated a note value that is above 127, so it has been bumped down one or more octaves to be in the proper MIDI range of 0 through 127.  Note that this is valid for MIDIToMusic() when using play modes DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of which store MIDI values in wMusicValue. With MusicToMIDI() it is valid for all play modes. Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.”)
(0×8781215, “DMUS_S_NOBUFFERCONTROL”, “Although the audio output from the port will be routed to the same device as the given DirectSound buffer, buffer controls such as pan and volume will not affect the output.”)
(0×8781216, “DMUS_S_GARBAGE_COLLECTED”, “The requested operation was not performed because during CollectGarbage the loader determined that the object had been released.”)
(0×8000000a, “E_PENDING”, “The data necessary to complete this operation is not yet available.”)
(0×80004001, “E_NOTIMPL”, “The function called is not supported at this time”)
(0×80004002, “E_NOINTERFACE”, “The requested COM interface is not available”)
(0×80004003, “E_POINTER”, “Invalid pointer”)
(0×80004004, “E_ABORT”, “Operation aborted”)
(0×80004005, “E_FAIL”, “An undetermined error occurred”)
(0×8000ffff, “E_UNEXPECTED”, “Catastrophic failure”)

Tagged with: .
Avatar

所有内容是根据http://blog.csdn.net/moonsunearth/archive/2007/09/25/1800790.aspx整理得来的。

首先Windows mobile自带的camera程序是不支持双camera的,如果要加入双camera一个方法是在原来的程序中插入一个菜单来实现调用(经验证菜单的加入是可以实现的),另一个比较推荐的做法是使用directshow自己写一个camera程序。

切换的关键部分是通过directshow控制camera,然后驱动对切换消息进行响应,切换sensor。

Directshow对camera控制的接口如下:

LRESULT hr;

     CComPtr<IAMCameraControl> pCameraControl;

long lCurrentVal,lCurrentFlags;

long CameraControl_Switch=CameraControl_Flash+0xff;

if(sensor>=SENSOR_MAX)
return FALSE;

     CHK(m_pVideoCapFilter->QueryInterface(&pCameraControl));

     CHK(pCameraControl->Get(CameraControl_Switch, &lCurrentVal, &lCurrentFlags));
if(lCurrentVal == sensor)
…{
//return TRUE;
     }
   CHK(pCameraControl->Set(CameraControl_Switch, sensor, CameraControl_Flags_Manual));

IAMCameraControl::Set函数会调用CAM_IOControl,Ioctl=IOCTL_CS_PROPERTY这个是让驱动进行响应的关键。

在CAM_IOControl函数中对应的IOCTL_CS_PROPERTY中的部分是

else if ( TRUE == IsEqualGUID( pCsProp->Set, PROPSETID_VIDCAP_CAMERACONTROL ) )

{

dwErr = pCamDevice->AdapterHandleCamControlRequests( pInBuf,InBufLen, pOutBuf, OutBufLen, pdwBytesTransferred );

}

对于我们代码的添加一个是在这里添加一个自己的customer函数,另一个方法是继续向上层走,然后在上层添加自己的函数。不过因为这里是mdd层,所以最好不要修改,放到pdd层。

整个的流程的修改基本上就是这么多了。

在驱动层需要实现不同camera sensor的切换,然后上层通过directshow的IAMStreamConfig实现。

CComPtr<IAMStreamConfig> pStremConfig;

    CHK(m_pCapGraphBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, 0, m_pVideoCapFilter, IID_IAMStreamConfig, (void **)&pStremConfig))

    CHK(pStremConfig->GetNumberOfCapabilities(&iCount, &iSize));

if (iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS))
…{
for (int iFormat = 0; iFormat < iCount; iFormat++)
…{
            VIDEO_STREAM_CONFIG_CAPS scc;
            AM_MEDIA_TYPE *pmtConfig;

CHK(pStremConfig->GetStreamCaps(iFormat, &pmtConfig, (BYTE*)&scc));
if (SUCCEEDED(hr))
…{
if(scc.MinOutputSize.cx == pSize->cx && scc.MinOutputSize.cy == pSize->cy)
…{
                    CHK(pStremConfig->SetFormat(pmtConfig));
                    DeleteMediaType(pmtConfig);
break;
                }
                DeleteMediaType(pmtConfig);
            }
        }
    }

Tagged with: .
Avatar

最终目的是实现一个类似可运行程序的框架的东西。
难点:如何生成这个可运行的程序数据。1.函数的跳转使用一个固定的地址中的函数指针实现。2.将程序数据解析成一行行的执行代码。
同时应该同应用程序的编译平台的实现有着直接的联系。
现在看起来第二种方式的实现应该还是简单点,同时可以做到不同平台的开发。当一个应用调试完成后,可以使用特殊的处理将源文件生成一个数组,然后在不同的另一个平台上只需要对该数组进行一次解析,将对应的数据转化为对应的具体平台的函数调用就可以实现同开发平台上同样的运行效果了。

对于第一种实现方式,主要的难点是需要对所有可能调用的api都要进行地址固定。这个可以通过一个全局的函数指针数组来实现跳转,开发时必须使用函数指针进行。在进行平台移植时,这个函数指针数组必须指定一个绝对的地址,同时这个地址与开发的应用程序或动态加载系统实现的对应的lib中的地址必须要一致,否则函数会跳转到错误的地址上。
分析下来看来都是可以实现的,个人觉得第二种方式可能会简单一点。

Tagged with: .
Avatar

Overview

This section offers a brief description of the different layers which constitute the mobile station Protocol Stack. It is also intended to offer an overview of the intersystem interface. The Protocol Stacks are used to define the functionality of the GSM protocols for interfaces. The GSM specifications are normative when used to describe the functionality of interfaces, but the stacks and the subdivision of protocol layers do not imply or restrict any implementation.

1 PL - Physical Layer

The base of the Protocol Stack rests on the physical layer.

2 DL - Data Link

The Data Link Layer (DL) is used to handle an acknowlowdged connection between mobile and base station. The LAPDm protocol is used.

3 RR - Radio Resource

Radio Resource (RR) manages the resources of the air-interface. That means configuration of physical layer, cell selection and cell reselection, data transfer, RR-Connection handling.

4 MM - Mobility Management

Mobility Management (MM) handles registration aspects for the mobile station. It detects changes of location areas and updates a mobile station in the new location area.

5 CC - Call Control

Call Control (CC) provides the call functionality. This includes call establishment, call maintenance

procedures like Hold, Retrieve or Modify, and call disconnection.

6 SS - Supplementary Services

Supplementary Services (SS) handles all call independent supplementary services like call forwarding or call barring.

7 SMS - Short Message Services

Short Message Services (SMS) is used for sending and receiving point-to-point short messages. Additionally the reception of cell broadcast short messages is included. Call Control (CC), Supplementary Services (SS) and Short Message Services (SMS) together are referred to as Connection Management (CM) sometimes.

8 MMI - Man Machine Interface

The man machine interface (MMI) is the interface to the user. Normally it is connected with a keypad as input device and a display as output device. In G23, there is a AT Command Interpreter (ACI), therefore, sometimes the MMI is also referred to as ACI in the present document if “the layer above layer 3″ is to be identified.

Between the several entities data interfaces are defined. These data interfaces are called Service

Access Points (SAPs), indicating that an upper layer uses the services of a lower layer.

The GSM specification do not set out any implementation of the Protocol Stack. The following diagrams show the implementation described in all these documents for the mobile station. All entities Technical Document GSM Protocol Stack Message Sequence Charts MM (6147.203.97.102), v0.3 Draft

except the Man Machine Interface and Physical Layer are implemented as part of the Protocol Stack - with ACI seen as an integral part of the stack in almost all cases.

For GPRS, there are more entities.

9 GRR (RLC/MAC) – Radio Link Control/Medium Access Control

This layer contains two functions: The Radio Link Control function provides a radio-solution-dependent reliable link. The Medium Access Control function controls the access signalling (request and grant) procedures for the radio channel, and the mapping of LLC frames onto the GSM physical channel.

10 LLC – Logical Link Control

The LLC entity provides multiple highly reliable logical links for asynchronous data transfer between the MS and the network. It supports variable-length information frames, acknowledged and unacknowledged data transfer, flow and sequence control,error detection and recovery, notification of unrecoverable errors, user identity confidentiality, and ciphering of user and signaling data.

11 GMM – GPRS Mobility Management

The GMM entity provides procedures for the mobility of the MS, such as informing the network of its present location, and user identity confidentiality. It manages the GMM context (attach, detach, routing area updating), supports security functions such as authentication of user and MS, controls ciphering of data, and initiates the response to paging messages.

12 SM – Session Management

The main function of the session management (SM) is to support PDP context handling of the user terminal. Session Management activates, modifies and deletes the contexts for packet data protocols (PDP). Session Management services are provided at the SMREG-SAP and the SNSM-SAP for anonymous and non-anonymous access. The non-anonymous and anonymous access procedures for PDP context activation and PDP context deactivation are available at the SMREG-SAP.In addition there exists a PDP context modification for non-anonymous PDP contexts.

13 SNDCP - Subnetwork Dependant Convergence Protocol

SNDCP carries out all functions related to transfer of Network layer Protocol Data Units (N-PDUs) over GPRS in a transparent way. SNDCP helps to improve channel efficiency by means of compression techniques. The set of protocol entities above SNDCP consists of commonly used network protocols. They all use the same SNDCP entity, which then performs multiplexing of data coming from different sources to be sent using the service provided by the LLC layer.

14 GACI – GPRS Application Control Interface

The GACI is the GPRS extension of the ACI. It is specified in GSM 07.07 and 07.60. It is responsible for processing of the GPRS related AT Commands to setup, activate and deactivate the PDP context parameter. It also provides functionality for the interworking between GMM/SM/SNDCP and a packet oriented protocol like PPP.

15 GSMS - GPRS Short Message Service

Like GACI, GSMS, the GPRS Short Message Service, is also not a new entity of its own, but it is the GSM SMS entity enhanced by GPRS functionality.

Tagged with: , .
Avatar

在code已经优化的情况下的做法,其他系统类似也应该可用。

1.code放到internal ram中去执行

2.code中使用的全局变量或动态分配的内存放到internal ram中。

3.执行该code时将系统堆栈设置到internal ram中。

Tagged with: .
Avatar

对SIM卡的操作必须严格按照GSM规范规定的协议进行。其格式如下:

•CLA •INS • P1 • P2 • P3 • Data
SIM卡返回数据格式如下:
Data •               SW1 • SW2

CLA:指令的类型
INS:指令代码。
P1,P2,P3:指令参数,其中P3表示data的长度。P3=00表示返回256字节长度的data。
SW1,SW2表示命令成功与否的状态。

在T=0的情况下,一些函数在使用select指令后需要使用get response指令并使用参数来得到对应的数据。
如果事先并不知道返回数据的长度,那么在第一个命令的返回状态中将会包括对应的长度。



SIM卡操作指令表如下
Read the rest of this post »

Tagged with: , .
Avatar

以下是一些比较重要的SIM卡中包含的EF信息。
EFLP (Language preference)
包含一个或多个语言的代码。
Identifier: ‘6F05′    Structure: transparent    Mandatory
File size: 1-n bytes                Update activity: low
Access Conditions:
READ           ALW
UPDATE        CHV1
INVALIDATE     ADM
REHABILITATE  ADM
Bytes Description                   M/O      Length
1 1st language code (highest prior.)    M        1 byte
2 2nd language code                 O           1 byte
n nth language code (lowest prior.)    O           1 byte

EFIMSI (IMSI)
包含IMSI(International Mobile Subscriber Identity)信息
Identifier: ‘6F07′ Structure: transparent Mandatory
File size: 9 bytes Update activity: low
Access Conditions:
READ CHV1
UPDATE ADM
INVALIDATE ADM
REHABILITATE CHV1
Bytes Description M/O Length
1 length of IMSI M 1 byte
2 - 9 IMSI M 8 bytes

EFKc (Ciphering key Kc)
包含用来加密的信息
Identifier: ‘6F20′ Structure: transparent Mandatory
File size: 9 bytes Update activity: high
Access Conditions:
READ CHV1
UPDATE CHV1
INVALIDATE ADM
REHABILITATE ADM
Bytes Description M/O Length
1 - 8 Ciphering key Kc M 8 bytes
9 Ciphering key sequence number n M 1 byte

EFPLMNsel (PLMN selector)
包含Mobile Network Code (MNC).和Mobile Country Code (MCC)信息
Identifier: ‘6F30′ Structure: transparent Optional
File size: 3n (n . 8) bytes Update activity: low
Access Conditions:
READ CHV1
UPDATE CHV1
INVALIDATE ADM
REHABILITATE ADM
Bytes Description M/O Length
1 - 3 1st PLMN (highest priority) M 3 bytes
22 - 24 8th PLMN M 3 bytes
25 - 27 9th PLMN O 3 bytes
(3n-2)-3n nth PLMN (lowest priority) O 3 bytes
Read the rest of this post »

Tagged with: , .
« Previous Page