2012-03-21 7 views
0

나는 이것을 source base에 대해 공부하고 있습니다. 기본적으로 이것은 믿을만한 방법으로 입력 이벤트를 사용하지 않고 입력 이벤트를 잡기 위해 Symbian 3rd 에디션 용 애님 서버 클라이언트입니다.RProperty IPC 통신

여기에 this line of the server이라고 표시하면 기본적으로 RProperty 값을 설정합니다 (분명히 증가하는 카운터로). 입력의 실제 처리가 수행되지 않는 것 같습니다.

this client line 안에있는 클라이언트는 알림 데이터를 받고 있지만 첨부 만 호출합니다.

understanding is that Attach 한 번만 호출 할 필요하지만 서버가 RProperty

하는 방법 (와) 설정 때마다 트리거 어떤 경우 클라이언트에서 명확하지 않은 RProperty 값에 액세스하는데 클라이언트입니다 내 ?

답변

1

Attach 후에 클라이언트는 TRequestStatus 참조를 전달하는 속성에 Subscribe 어딘가에 있습니다. 비동기 이벤트가 발생하면 서버가 요청 상태 속성을 커널을 통해 알립니다 (속성이 변경된 경우). 예제 소스 코드가 올바른 방법으로 구현되면 액티브 개체 (AO; CActive 파생 클래스)가 붙어 있으며이 AO의 iStatus은 RProperty API로 전달됩니다. 이 경우 속성이 변경되면 AO의 RunL 함수가 호출됩니다.

활성 객체 프레임 워크를 이해하고 실제로는 거의 사용하지 않는 것이 심비안에서 필수적입니다. 불행히도 나는 정말 좋은 설명을 온라인으로 찾지 못했다. (그들은 Symbian OS Internals에서 꽤 잘 설명되어있다.) 적어도 this page은 빠른 예제를 제공한다.

CActive 당신의 CMyActive 서브 클래스의 ConstructL에서

:

CKeyEventsClient* iClient; 
RProperty   iProperty; 
// ... 

void CMyActive::ConstructL() 
    { 
    RProcess myProcess; 
    TSecureId propertyCategory = myProcess.SecureId(); 
     // avoid interference with other properties by defining the category 
     // as a secure ID of your process (perhaps it's the only allowed value) 
    TUint propertyKey = 1; // whatever you want 

    iClient = CKeyEventsClient::NewL(propertyCategory, propertyKey, ...); 
    iClient->OpenNotificationPropertyL(&iProperty); 

    // ... 

    CActiveScheduler::Add(this); 
    iProperty.Subscribe(iStatus); 
    SetActive(); 
    } 

속성이 변경되었을 때 귀하의 RunL가 호출됩니다 점에서

void CMyActive::RunL() 
    { 
    if (iStatus.Int() != KErrCancel) User::LeaveIfError(iStatus.Int()); 
     // forward the error to RunError 

    // "To ensure that the subscriber does not miss updates, it should 
    // re-issue a subscription request before retrieving the current value 
    // and acting on it." (from docs) 
    iProperty.Subscribe(iStatus); 

    TInt value; // this type is passed to RProperty::Define() in the client 
    TInt err = iProperty.Get(value); 
    if (err != KErrNotFound) User::LeaveIfError(err); 

    SetActive(); 
    } 
+0

그래, 소스 프로젝트 구독은 어디서나 호출되지 않으므로 아직 기능이없는 것 같습니다. 예를 들어 주셔서 감사합니다, 거기에보고 내가 그들이 속성 값에 액세스하는 데 도움이되는지 확인합니다. 그래서 당신의 의견으로 RProperty를 통해 통신을 수신 할 수 있도록 그 구현 (구독 외)에서 누락 된 무엇입니까? – lurscher

+0

몇 가지 초안 예제를 추가했습니다. – MrTJ

+0

이제 DLL에 ProtServ 기능이 있어야한다는 것을 알았습니다. 한 번 소프트웨어를 출시 할 계획이라면 Nokia는 왜 그런 질문을 할 수 있습니까? http://www.developer.nokia.com/Community/Wiki/Capabilities_%28Symbian_Signed%29/ProtServ_Capability – MrTJ