2010-06-14 3 views
0

저는 Motorola MC75 용 맞춤형 응용 프로그램 개발을 돕고 있습니다. 바코드 판독기가있는 임의의 버그를 제외하고는 잘 조정되었습니다. 정기적으로 바코드 리더는 오른쪽 어깨 버튼을 누르면 활성화됩니다 (읽기 시작). 가운데 단추와 왼쪽 단추가 어떻게 든 비활성화됩니다. 이는 임의로 발생하고 3 개의 버튼 중 2 개만 효과가 있다는 점에서 고유 한 버그입니다. EMDK는 모든 버튼을 동시에 활성화하므로 어디에서 오는 것인지 알 수 없습니다 (내부 또는 코드 관련). 누구든지 어떤 조언이나 조언이 있다면 미리 알려 주시고 고맙습니다.MC75 바코드 리더 문제

감사합니다,

자크는

답변

1

나는 MC55에 전에 모토로라 EMDK와 함께 일했습니다. 왜 버튼이 비활성화되어 있는지 잘 모르겠습니다. 6 월에 게시 했으므로 더 이상 답변이 필요하지 않을 수도 있지만 가능한 해결 방법은 다음과 같습니다.

EMDK가 트리거를 자체 처리하도록하는 대신 , 당신은 이벤트를 설정하여 모든 트리거를 캡처 할 수 있습니다 :

// Create a trigger device to handle all trigger events of stage 2 (pressed) or RELEASED 
var device = new TriggerDevice(TriggerID.ALL_TRIGGERS, new[] { TriggerState.RELEASED, TriggerState.STAGE2 }); 
var trigger = new Trigger(device); 
trigger.Stage2Notify += OnTrigger; 

그런 다음 OnTrigger 방법, 당신은 트리거를 처리하고 적절한 조치를 수행 할 수 있습니다. 예를 들어 트리거를 누르면 바코드 리더를 활성화 할 수 있습니다.

private void OnTrigger(object sender, TriggerEventArgs e) 
{ 
    if (e.NewState == e.PreviousState) 
     return; 

    // Pseudocode 
    if (e.NewState == TriggerState.RELEASED) 
    { 
     myBarcodeReader.Actions.ToggleSoftTrigger(); 
     myBarcodeReader.Actions.Flush(); 
     myBarcodeReader.Actions.Disable(); 
    } 
    else if (e.NewState == TriggerState.STAGE2) 
    { 
     // Prepare the barcode reader for scanning 
     // This initializes various objects but does not actually enable the scanner device 
     // The scanner device would still need to be triggered either via hardware or software 
     myBarcodeReader.Actions.Enable(); 
     myBarcodeReader.Actions.Read(data); 
     // Finally, turn on the scanner via software 
     myBarcodeReader.Actions.ToggleSoftTrigger(); 
    } 
}