Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Skyper activation call in subscriber settings #18

Open
dh3wr opened this issue Feb 14, 2019 · 2 comments
Open

Implement Skyper activation call in subscriber settings #18

dh3wr opened this issue Feb 14, 2019 · 2 comments

Comments

@dh3wr
Copy link
Member

dh3wr commented Feb 14, 2019

Where Type === SKYPER
Button und Notification-Box

@dh3wr
Copy link
Member Author

dh3wr commented Feb 14, 2019

@Override
	public PagerMessage createMessageFromActivation(Activation activation) {
		List<String> activationCode = Arrays.asList(settings.getActivationCode().split(","));
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < activationCode.size(); ++i) {
			List<String> activationSubCode = Arrays.asList(activationCode.get(i).split(" "));
			if (activationSubCode.size() != 3) {
				return null;
			}

			int shift = Integer.parseInt(activationSubCode.get(0));
			int mask = Integer.parseInt(activationSubCode.get(1));
			int offset = Integer.parseInt(activationSubCode.get(2));

			int cInt = ((activation.getNumber() >> shift) & mask) + offset;
			char c = (char) cInt;
			sb.append(String.valueOf(c));
		}

		return new PagerMessage(sb.toString(), activation.getNumber(), PagerMessage.MessagePriority.ACTIVATION,
				PagerMessage.FunctionalBits.ACTIVATION);
	}

@dh3wr
Copy link
Member Author

dh3wr commented Feb 14, 2019

private String activationCode = "0 7 50,0 7 34,0 7 53,0 7 51,0 7 51,0 7 52,0 7 52,0 7 52";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant